- Do you want to request a feature or report a bug?
Bug
- What is the current behavior?
Running gatsby build produces:
warning in ./~/netlify-cms/dist/cms.js
Critical dependencies:
49:378-385 This seems to be a pre-built javascript file. Though this is possible, it's not recommended. Try to require the original source to get better results.
- If the current behavior is a bug, please provide the steps to reproduce.
[email protected], [email protected] and [email protected]gatsby build- What is the expected behavior?
The site should be built without a warning
- Please mention your versions where applicable.
Netlify CMS version: ^1.8.0
Browser version: N/A
Node.JS version: latest
Operating System: OS X
- Referenced Issue
This issue was originally reported here: https://github.com/gatsbyjs/gatsby/issues/5485
@erquhart @KyleAMathews What is Gatsby wanting here? Does it want code that is transpiled but unbundled, or something else?
I've been running into this too
@tech4him1 I believe this is because Webpack wants ESM files, not a bundled UMD-file so it can do import analysis and tree shaking.
It is pretty common to build an unbundled project using babel then use the module key in package.json so that webpack uses the unbundled files as its entrypoint for the library.
I just have updated the dependencies in a gatsby project and I'm running into the same WARNING with netlify-cms. Another weird thing is creating a folder Users/username/…/gatsby-starter/public/ in the root of the project folder. As something was wrong with the node path…
Does anyone encounter that also?
problem solved with gatsby-remark-relative-images
@esphen That's something we've been trying to figure out. The problem is that we currently have other assets like SVG and CSS that require a WebPack loader to split out. If there is a way to do that, I'd be glad to implement. Any ideas?
Same issue here. Any updates?
warning in ./~/netlify-cms/dist/cms.js
Critical dependencies:
42:378-385 This seems to be a pre-built javascript file. Though this is possible, it's not recommended. Try to require the original source to get better results.
@ ./~/netlify-cms/dist/cms.js 42:378-385
@heyalbert I believe we just need a way to address my comment above on the WebPack loader: https://github.com/netlify/netlify-cms/issues/1389#issuecomment-394730850.
@tech4him1 @grdp can you elaborate on how to apply this fix?
The easiest I found to fix this is to use a pre-build using webpack that puts a fully built cms into static/admin and remove the plugin from gatsby. Is anyone interested in that solution? I made some changes in a PR in gatsby to partially fix the plugin for gatsby v2 but it turns out to be a lot harder when using a production compile of gatsby.
@githubr Sure. It's pointless noise for the maintainers. Use the reaction feature to +1 the issue instead.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Doesn't seem to happen in latest version of Gatsby and the cms plugin. Please re-open if needed.
Most helpful comment
@githubr Sure. It's pointless noise for the maintainers. Use the reaction feature to +1 the issue instead.