-
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
[1.0] Typeface produces error in production build #1043
Comments
No idea what's happening... can you reproduce this on another site? |
I've tried gatsbygram but can't seem to reproduce it. Copying the typeface module files to my src files and including the css directly from my code fixes the problem. I'll use that as a workaround until I am able to investigate further... |
We are just now observing this error as well in |
I had this. As much as I could figure out, it happens whenever I import the layout/index.js file by myself from somewhere (rather than letting only gatsby do it). It seems to screw up the webpack splitting, which then means that |
I'm running into this issue now here: It happens occasionally when you navigate between pages. I can't reliably reproduce it, but when it happens the navigation fails. Then sometimes you can click the link again and it will work, sometimes you have to refresh the page. The source code is here, trying to debug it and figure it out: https://github.com/octalmage/jason.stallin.gs |
Hi, I'm actually getting this same issue, its strange as it seems to come up only on (some?) production builds. It looks like the error is happening on this line in webpack bootstrap:
In my case the I did some investigating, and I think I may have a reason, but I have no idea what is causing it yet... If I look at my built path---index-*.js file I see that it is defining a module with id path---index-a0e39f21c11f6a62c5ab.js
Looking at the app-*.js bundle, I can find the corresponding mapping there (I matched on that hash value). In this case it seems to be trying to load module app-bc4b6baa4911562f087f.js
Interestingly, if I look at the 'mapped' js code I see that it thinks the path---index-a0e39f21c11f6a62c5ab.js (mapped)
So it looks like there is something happened to the output of the page file after it creates the .map file, but before the final output is complete... I guess? In my case, the page is shows up because of the initial server side render, but the js is unable to run at all. It seems I get the module mismatch issues on a number of pages in my production build. |
Interestingly, If I run the build locally (via gatsby build) I get a path---index-a0e39f21c11f6a62c5ab.js/path---index-a0e39f21c11f6a62c5ab.js.map file which is correct BUT the actual moduleId is different - they are both showing This might be a possible cause to the issue? Why is the file hash the same when the actual content is different? Actually... We are using cloudflare to do caching, so yup, as soon as I cleared the cache our pages are working again (after a hard-cache-refresh). For whatever reason, if I delete the public folder and rebuild it, I am still getting So to summarize - the problem occurs during deployment - as the internal module ids are changing (sometimes) even though the hash of the page is staying the same. This would obviously cause havoc with client-side caching etc. |
Looks like the fix might involve fixing up the module/chunk plugins that are being used?
Looking at the implementation of the HashedChunkIdsPlugin - it is generating the id from the hash of the name of the module, however for async chunks the name is actually undefined, so I think in those cases it falls back to using a numbered id. I am using this combination of ModuleId/Chunks plugins in another project to get consistent module/chunk naming, based of the content of their respective pieces:
This way, when a single module changes, it will have a consistent module id (regardless of order/environment/etc) and any chunks that include that id will also change consistently, even if they are being created from async code split. Saying that - I'm not 100% sure this would fix the issue, because for some reason the chunkhash was the same even though the content was different (ie the module id). I don't really see how this could have happened... Apparently once upon a time webpack chunkhash was not deterministic, but it should be now. Maybe need to use something like webpack-md5-hash to force it? |
I believe I might have fixed it with this commit: octalmage/jason.stallin.gs@28cd2a7 Still testing it though. |
I'm also having this issue between 2 versions of an application: I have a file v.1.1
v.1.0
|
What was the resolution to this problem? We're also having this problem -- not related to Bootstrap tho. Seems like the webpackJsonp referencing the wrong hashed js file. |
Today I have encountered the same issue and can not get it to work. Do you guys have any updates on this? |
Possible fix in #3652, please test if you're still having this issue. |
I've upgraded to Gatsby 1.9.178 and I'm still having this issue. |
I can confirm the problem on 1.9.173, but it got vanished with update to 1.9.186 (perhaps some other dep version change). It was not reproducible on desktop, but hard reproducible in mobile Chrome with react router Redirect, like: import React from 'react'
import { Redirect } from 'react-router'
const Landing = () => (
<Redirect to="/docs/" />
)
export default Landing It looks like some sort of race condition. However, I am not completely sure if the problem is really fixed, but not just hidden. |
@andvgal Thanks for the update, you're right! Updated gatsby and my site is working. |
I had the error on 1.9.158 and I just updated to 1.9.199 and I still have the error. |
Ran into the same issue, I was on version Edit: I spoke to soon. A second run through CI resulted int the same error. |
Having this problem on
|
Update: deployed my portfolio test site to Netlify. No errors. **** Update: site started working on Github this the following morning, error has disappeared. |
Same issue here |
I ran into this, and the root problem was that I was caching JS files, which Gatsby v1 doesn't support. See #2538 and docs on caching. The problem's fixed since we made sure our CDN doesn't cache JS. |
I just briefly ran into this problem again, and it had to do with caching for me too. I was doing a local test of a prod build and using |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub issues, we have to clean some of the old issues as many of them have already been resolved with the latest updates. Please make sure to update to the latest Gatsby version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 |
This issue is being closed because there hasn't been any activity for at least 30 days. Feel free to open a new one if you still experience this problem 👍 |
I'm importing a typeface package in my default layout. It works in development. In production the font also loads, but produces the following error.
It points to this line in bootstrap
And further down
in index.css
I didn't change anything to the webpack configuration regarding css. Any idea what might cause this?
The text was updated successfully, but these errors were encountered: