Skip to content
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

Cannot read property 'toString' of undefined #2625

Closed
TrySound opened this issue Jan 1, 2019 · 3 comments · Fixed by #2638
Closed

Cannot read property 'toString' of undefined #2625

TrySound opened this issue Jan 1, 2019 · 3 comments · Fixed by #2638

Comments

@TrySound
Copy link
Member

TrySound commented Jan 1, 2019

  • Rollup Version: 1.0.0
  • Operating System (or Browser):
  • Node Version: 8.15

How Do We Reproduce?

Don't know how yet. Will try to reproduce.

Expected Behavior

No errors

Actual Behavior

./src/index.js → build/static/js...
[!] TypeError: Cannot read property 'toString' of undefined
TypeError: Cannot read property 'toString' of undefined
    at Chunk.getRenderedHash (project/node_modules/rollup/dist/rollup.js:15468:41)
    at project/node_modules/rollup/dist/rollup.js:15513:33
    at Chunk.visitDependencies (project/node_modules/rollup/dist/rollup.js:15493:13)
    at Chunk.computeContentHashWithDependencies (project/node_modules/rollup/dist/rollup.js:15509:14)
    at project/node_modules/rollup/dist/rollup.js:15731:34
    at project/node_modules/rollup/dist/rollup.js:14863:27
    at String.replace (<anonymous>)
    at renderNamePattern (project/node_modules/rollup/dist/rollup.js:14862:20)
    at Chunk.generateId (project/node_modules/rollup/dist/rollup.js:15726:30)
    at assignChunkIds (project/node_modules/rollup/dist/rollup.js:17660:19)
@TrySound
Copy link
Member Author

TrySound commented Jan 1, 2019

I guess this happens because of falsy dynamic import like this

const Page = false
  ? React.lazy(() =>
      import('./page.js').then(module => ({ default: module.Page })),
    )
  : () => null;

console.log(Page)

@lukastaegert
Copy link
Member

Thanks, your findings were very helpful! Fix at #2638

@TrySound
Copy link
Member Author

TrySound commented Jan 5, 2019

Great! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants