-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
gatsby build issues - likely async related #3931
Comments
@gbailey4 I had a go at fixing this, based on @Kalcode's comment . First install a couple of babel plugins: Then add the following to your exports.modifyBabelrc = ({ babelrc }) => ({
...babelrc,
plugins: babelrc.plugins.concat(['transform-regenerator']),
}) That left the build with a different error, which looks like it's related to trying to run browser code in Node. I'm not familiar with Apollo but if it should be client-only code, you'll need to check you're in a browser before running it. There's a bit more info at https://www.gatsbyjs.org/docs/debugging-html-builds/ |
Thank you very much. I actually forgot about the other error, but do have a fix for that. I will trust your fix soon and hope it goes as predicted! |
OK, so I was able to get it working. I fixed the issue with Apollo through some process.browser handling. Then, however, I needed to add the module 'regenerator-runtime' in dev dependancies and in the file with an async function That worked upon doing gatsby build! Thanks so much for your help, this was a huge help. |
Had the same alert with async/await, @m-allanson is right on with the transform-regenerator recommendation. UPDATED: To follow back up on a related issue when implementing... The above fix worked when running 'gatsby build' for production, but I ran into another console error running 'gatsby develop' "Uncaught (in promise) ReferenceError: regeneratorRuntime is not defined" to resolve, I included babel-plugin-transform-runtime as a dev dependincy and concat it with our generator. exports.modifyBabelrc = ({ babelrc }) => ({
...babelrc,
plugins: babelrc.plugins.concat(
['transform-regenerator'],
['transform-runtime']
),
}) |
This is the simplest solution I could find to solve both dev and prod which did not require My {
"env": {
"development": {
"plugins": ["transform-async-to-generator"] // also works, but older: "syntax-async-functions"
},
"production": {
"plugins": ["transform-regenerator", "transform-runtime"]
}
}
} |
I have my fix similar to @gscottqueen but in
|
This reverts commit fe06a79. Revert "remove gatsby-source-youtube" This reverts commit cb4c1b6. Revert "switch gitlab ci to yarn" This reverts commit c3bbe2b. Revert "disable cache" This reverts commit f38b2e1. Revert "upgrade gatsby to 2.0" This reverts commit 9c9e2cf. Revert "gatsbyjs/gatsby#3931 (comment)" This reverts commit 5e69385. Revert "bump gatbsy cli tools" This reverts commit c886660. Revert "bump node to LTS" This reverts commit d3a66f2. Revert "adds videos page" This reverts commit 235a665.
hey all, I seem to be running into something similar? I am using async/awaits in some plugins. Got these errors: So I tried:
And the errors still look exactly the same! |
@hassanshaikley this looks more like a 404. what is the response from that js url? |
Description
Upon running
gatsby build
the build process crashes on the minify js portion.Environment
Gatsby version:
1.9.158
Node.js version:
8.9.1
Operating System:
macOS 10.13.3
File contents (if changed):
gatsby-config.js
: no changepackage.json
: no changegatsby-node.js
: no changegatsby-browser.js
: no changegatsby-ssr.js
: no changeActual result
error thrown:
Expected behavior
successful build of project
Steps to reproduce
1. Build the repo here:
https://github.com/gbailey4/SimpleLunch
2.
The specific file that is throwing the error is here:
https://github.com/gbailey4/SimpleLunch/blob/master/src/components/CreateLuncher.js
...
The text was updated successfully, but these errors were encountered: