Open stx-chris opened 1 year ago
Not sure if this is the same error, since updating to 13.2.3 from 13.1.2 I can no longer build because it seems as though webpack cannot import any modules anymore.
There are pages of these types of errors
../../libs/server/next-auth/src/lib/server-next-auth.ts
Module parse failed: Unexpected token (8:12)
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
| import GithubProvider from 'next-auth/providers/github';
|
> import type { GetServerSidePropsContext } from 'next';
As a workaround, I could mitigate this issue by adding the package to the webpack externals list as follows:
webpack: (config, options) => {
config.externals = [...config.externals, "opencv-wasm"]
return config;
}
However, I hope that future versions of next.js will fix this loader problem.
I'm getting the same error trying to import a WASM module in a file imported to a route.ts
:
import * as CMS from '@emurgo/cardano-message-signing-nodejs';
Error:
Error: ENOENT: no such file or directory, open '/Users/{...}/.next/server/chunks/cardano_message_signing_bg.wasm'
I wasn't entirely sure if this is a bug or if what I'm trying is unsupported. I'm assuming the former?
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Middleware / Edge (API routes, runtime)
Link to the code that reproduces this issue
https://codesandbox.io/p/sandbox/determined-voice-3xxxo4
To Reproduce
Tried to migrate to the new api spec (Next.js 13.2). When the package
opencv-wasm
is required or imported, the call to the api fails. Doing it the classic way (/pages
), this works just fine.Classic way (succeeds):
New way (fails):
Describe the Bug
Expected Behavior
Should work as before. All other settings are equal.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response