Home
Support Forums

[Netlify build] [Typescript] no loaders are configured to process this file type

PLEASE help us help you by writing a good post!

*My site: ghappy-neumann-adbd49.netlify.app

Error detail: I’m using puppeteer + chrome-aws-lambda for my side-project but some how when i run netlify build i get no loaders are configured to process this file type error when using ts-loader
The log build of netlify build

Enviroment : Ubuntu LTS 20.04



────────────────────────────────────────────────────────────────
  Netlify Build                                                 
────────────────────────────────────────────────────────────────

❯ Version
  @netlify/build 15.2.2

❯ Flags
  dry: false
  offline: false

❯ Current directory
  /home/hoangtho/Desktop/stupid-fetcher

❯ Config file
  No config file was defined: using default values.

❯ Context
  production

❯ Installing plugins
   - @netlify/plugin-nextjs@3.6.3

❯ Loading plugins
   - @netlify/plugin-nextjs@3.6.3 from Netlify app

────────────────────────────────────────────────────────────────
  1. onPreBuild command from @netlify/plugin-nextjs             
────────────────────────────────────────────────────────────────

Using Next.js 11.0.1
info  - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
No Next.js cache to restore.

(@netlify/plugin-nextjs onPreBuild completed in 611ms)

────────────────────────────────────────────────────────────────
  2. Build command from Netlify app                             
────────────────────────────────────────────────────────────────

$ yarn run build
yarn run v1.22.10
warning ../../package.json: No license field
$ next build
info  - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
info  - Checking validity of types  
(node:12318) [DEP_WEBPACK_CHUNK_HAS_ENTRY_MODULE] DeprecationWarning: Chunk.hasEntryModule: Use new ChunkGraph API
(Use `node --trace-deprecation ...` to show where the warning was created)
info  - Creating an optimized production build  
Failed to compile.

./node_modules/chrome-aws-lambda/build/puppeteer/lib/Browser.js.map
Module parse failed: Unexpected token (1:10)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> {"version":3,"file":"Browser.js","sourceRoot":"","sources":["../../../source/puppeteer/lib/Browser.ts"],"names":[],"mappings":";;AAGA,IAAI,KAAK,GAAuB,IAAI,CAAC;AAErC,IAAI;IACF,KAAK,GAAG,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dist/build/index.js:15:924
    at async Span.traceAsyncFn (/home/hoangtho/Desktop/stupid-fetcher/node_modules/next/dist/telemetry/trace/trace.js:6:584)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

────────────────────────────────────────────────────────────────
  "build.command" failed                                        
────────────────────────────────────────────────────────────────

  Error message
  Command failed with exit code 1: yarn run build

  Error location
  In Build command from Netlify app:
  yarn run build

  Resolved config
  build:
    command: yarn run build
    commandOrigin: ui
    publish: /home/hoangtho/Desktop/stupid-fetcher/out
    publishOrigin: ui
  functions:
    '*': {}
  plugins:
    - inputs: {}
      origin: ui
      package: '@netlify/plugin-nextjs'

   ╭────────────────────────────────────────────────────────╮
   │                                                        │
   │    Please update netlify-cli to its latest version.    │
   │     If netlify-cli is already the latest version,      │
   │   please update your dependencies lock file instead.   │
   │                                                        │
   ╰────────────────────────────────────────────────────────╯

webpack.config.js

const path = require( 'path' );
module.exports = {

    mode: 'production',
    entry: '.pages/api/index.ts',
    output: {
        path: path.resolve( __dirname, 'dist' ),
        filename: 'main.js',
    },
    resolve: {
        extensions: [ '.ts', '.js' ],
    },
    // loaders
    module: {
        rules: [
            {
                test: /\.tsx?/,
                use: 'ts-loader',
                exclude: /node_modules/,
            }
        ]
    }
};

hi there, sorry to be slow to reply. We’re still hoping to get you some more information on this! thanks for your patience.

Hi @hoangtho1997,

Is it possible for you to share the source code? It looks like Webpack is trying to parse the source map with (or instead of) the actual TS file. Thus, it says it needs more loaders.

1 Like

Im so sorry for late reponse. Really sad that i delelted the source code of my github already . and i switched to another method. So how can i close the topic ?

No action needed on your part to close the topic. You can leave it unanswered, we’d take it from here.