-
Notifications
You must be signed in to change notification settings - Fork 27.8k
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
Chunk names are not saved properly #4603
Comments
timneutkens
pushed a commit
that referenced
this issue
Jun 14, 2018
Fixes #4603. Tests explain it the best: ```js describe('development mode (no chunkhash)', () => { it('should strip the extension from the filename', () => { const filename = 'foo_bar_0123456789abcdef.js' expect(getChunkNameFromFilename(filename, true)).toBe('foo_bar_0123456789abcdef') }) it('should only strip the extension even if there\'s a hyphen in the name', () => { const filename = 'foo-bar-0123456789abcdef.js' expect(getChunkNameFromFilename(filename, true)).toBe('foo-bar-0123456789abcdef') }) }) describe('production mode (with chunkhash)', () => { it('should strip the hash from the filename', () => { const filename = 'foo_bar_0123456789abcdef-0123456789abcdef.js' expect(getChunkNameFromFilename(filename, false)).toBe('foo_bar_0123456789abcdef') }) it('should only strip the part after the last hyphen in the filename', () => { const filename = 'foo-bar-0123456789abcdef-0123456789abcdef.js' expect(getChunkNameFromFilename(filename, false)).toBe('foo-bar-0123456789abcdef') }) }) ```
lependu
pushed a commit
to lependu/next.js
that referenced
this issue
Jun 19, 2018
Fixes vercel#4603. Tests explain it the best: ```js describe('development mode (no chunkhash)', () => { it('should strip the extension from the filename', () => { const filename = 'foo_bar_0123456789abcdef.js' expect(getChunkNameFromFilename(filename, true)).toBe('foo_bar_0123456789abcdef') }) it('should only strip the extension even if there\'s a hyphen in the name', () => { const filename = 'foo-bar-0123456789abcdef.js' expect(getChunkNameFromFilename(filename, true)).toBe('foo-bar-0123456789abcdef') }) }) describe('production mode (with chunkhash)', () => { it('should strip the hash from the filename', () => { const filename = 'foo_bar_0123456789abcdef-0123456789abcdef.js' expect(getChunkNameFromFilename(filename, false)).toBe('foo_bar_0123456789abcdef') }) it('should only strip the part after the last hyphen in the filename', () => { const filename = 'foo-bar-0123456789abcdef-0123456789abcdef.js' expect(getChunkNameFromFilename(filename, false)).toBe('foo-bar-0123456789abcdef') }) }) ```
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bug report
Describe the bug
Chunk names are not processed properly which causes problems with SSR.
To Reproduce
dynamic(import('...'))
.yarn next
Expected behavior
Component's chunk should be properly marked and loaded on the client side before the page is hydrated.
System information
Additional context
The problem was introduced in #4436 - in development mode chunk names don't include hash anymore. Since "available" chunk names are processed by removing the last hyphen and the part that comes after it (e.g.
file-0123456789.js
->file
) and the only hyphen is now gone, chunk names are not changed anymore:file.js
->file.js
.I've prepared a fix for that, will submit a PR soon.
The text was updated successfully, but these errors were encountered: