-
Notifications
You must be signed in to change notification settings - Fork 27k
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
JavaScript does not get loaded on the custom _error.js page #4231
Comments
Try upgrading to Next 6 |
Thanks for following the issue template perfectly 🙏 |
Is that the answer to this problem? |
If you're not customizing .babelrc/next.config.js we're 100% backwards compatible with 4.2.3, otherwise you might have to make some changes. |
Hi, getting back on this thread because I have tried migrating but I have customized next.config.js and .babelrc and when I tried migrating babel was giving me errors and I lost too much time trying to do that, so I eventually ignored this for a while. I would really like to find a solution to this that does not involve the migration. A couple of things I can imagine but wouldn't know how to implement in next exactly:
If all else fails, do you have a common issues migration guide with a customized .babelrc that states exactly what configurations/babel-syntax is not backward compatible? I have tried debugging this but I'm getting errors I can't find mentioned on any other threads and it's gonna take me too long to fix this myself :/ |
@MatthiasMargot can you post your .babelrc + the errors you're getting? |
{
"presets": [
"next/babel", "flow"
],
"plugins": [
"inline-react-svg",
"transform-flow-strip-types",
["babel-plugin-root-import",
[
{
"rootPathPrefix": "~"
},
{
"rootPathPrefix": "@",
"rootPathSuffix": "src/components"
},
{
"rootPathPrefix": "#",
"rootPathSuffix": "src/utils"
}
]
],
"babel-plugin-styled-components",
["styled-components", {
"ssr": true,
"displayName": true,
"preprocess": false }
],
["transform-define", "./env-config.js"]
]
}
|
The error is actually pretty clear,
this must be an object. Seems like it's an open pull request here: entwicklerstube/babel-plugin-root-import#93 Also |
Yeah we need to get that PR entwicklerstube/babel-plugin-root-import#93 approved. |
Going to close this as it works fine on latest. |
None of my JavaScript gets loaded on the custom _error page in a production bundle, works fine in development though.
There's also things on the _error page that are reused elsewhere in the application like a common header that has some JavaScript for letting a user log in/sign out.
In the console I can see some errors saying the scripts can't be found.
Is this normal behaviour that you simply can't run any JavaScript on the _error page? Is there any way to hack around this?
Steps to Reproduce (for bugs)
Context
I was asked to implement a newsletter subscription form on the custom error page in order to give the user the ability to be notified as soon as a certain page exists because we have links that don't lead anywhere yet for a second stage of the project.
Your Environment
The text was updated successfully, but these errors were encountered: