-
Notifications
You must be signed in to change notification settings - Fork 27.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom dev server get Error: TypeError: Cannot read properties of undefined (reading 'ProvidePlugin') #46588
Comments
This looks related to #45413. It looks like next version |
Any updates for this one? |
Actually all versions I tested up until StackBlitz (working) And then versions starting with StackBlitz (broken) |
My StackBlitzes above and this comment in #45413 by @farhan2077 leads me to think that aa0664c may be the cause. @ijjk it seems that aa0664c (your PR #43198 with the experimental precompiled |
Any news on this? I'm seeing the exact same issue on
Throws a webpack error —
|
WorkaroundThe way we have worked around it for now is to set // util/next.ts
import { dirname, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import next from 'next';
const app = next({
dev: !('NODE_ENV' in process.env) || process.env.NODE_ENV === 'development',
hostname: 'localhost',
port: 3000,
// Path to next.config.js
dir: resolve(
dirname(fileURLToPath(import.meta.url)),
'..',
),
}); |
Thanks @karlhorky, I left that out because I didn't think it was relevant to the issue. We are setting |
What I meant is that you can use |
The issue is we need to pass dynamic runtime secrets from the Express server, and we cannot import them into |
This is no longer needed as the experimental precompiled server was removed. Closes: #46588
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
Operating System:
Platform: MacOS
Arch: M1
Binaries:
Node: 16.4.2
npm: 7.17.0
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 13.2.1
eslint-config-next: N/A
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://stackblitz.com/edit/nextjs-n5mjba?file=package.json,server.js
To Reproduce
server.js
in root directorywebpack
andexpress
server.js
, can pass any config intonext()
node server.js
start the serverDescribe the Bug
If I pass any next.config into
next({conf=${ANY_NEXT_CONFIG}})
, will get error:Expected Behavior
Dev server to spin up in localhost:3000.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
The text was updated successfully, but these errors were encountered: