next.js: Webpack loaders not found when building with `next@13.2.1`

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System: Platform: win32 Arch: x64 Version: Windows 10 Home Binaries: Node: 16.19.0 npm: N/A Yarn: N/A pnpm: N/A Relevant packages: next: 13.2.1 eslint-config-next: 13.1.1 react: 18.2.0 react-dom: 18.2.0

Which area(s) of Next.js are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue

https://github.com/LuckeeDev/csl

To Reproduce

Install next@13.2.1 and run yarn build web. The error will prevent the build from completing, whereas with next@13.1.6 everything works fine.

Describe the Bug

I get multiple statements like the following when building the project:

Module parse failed: The keyword 'interface' is reserved (4:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. S
ee https://webpack.js.org/concepts#loaders
| import axios from 'axios';
|
> interface TokensResponse {
|       access_token: string;
|       expires_in: number;

Expected Behavior

The build should work without errors.

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 17
  • Comments: 17 (6 by maintainers)

Commits related to this issue

Most upvoted comments

Related: https://github.com/vercel/next.js/pull/45455

This is a breaking change that shipped with Next.js 13.2.0.

Note: the vanilla-extract issue seems like a different issue and unrelated to the change in the linked PR, we are investigating it.

We had to downgrade nextjs for product deployments to 13.1.6 as others have suggested. font-loader-manifest.json was creating an error for us. Sharing for others who search for this issue since it wasn’t easy for us to locate and cost us some dev time.

image

Seems NX uses Next.js internals that are not documented and do not fall under any guarantee that they’ll exist in the future given that they’re not documented and not part of the public api. e.g. importing next/dist/x is a clear marker that internals are being used. These internals have now changed in 13.2 to allow running the webpack build in a separate worker to further parallelize the build steps across multiple cores, which will be enabled soon for all builds.

nx migrate 15.9.0-beta.2

fixes it for me

https://github.com/nrwl/nx/releases/tag/15.9.0-beta.2 includes https://github.com/nrwl/nx/pull/15650 which should fix this 🎉

Is this solved?

Not yet. Having trouble to build next 13.2.x in NX 15.7.2