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

Unable to build with Parcel - ReferenceError primitives import is not defined #2026

Open
itswyll opened this issue Sep 23, 2022 · 4 comments
Labels

Comments

@itswyll
Copy link

itswyll commented Sep 23, 2022

Describe the bug
I'm currently running into the exact same issue listed here: #1786

This is running on Parcel V2 with React 18, and ReactPDF V3.

Comparing to this same issue here #1915, the main thing I notice is that I'm using npm and them yarn.

I'm still able to run the app normally while doing development. It's explicitly the dist build with this issue.

To Reproduce

  1. Create a base parcel project with npm and react-pdf
  2. Run a parcel build to create a dist/ folder
  3. serve it using either serve or http-server

Screenshots
image

@itswyll
Copy link
Author

itswyll commented Sep 26, 2022

Creating the dist using npx parcel build --no-scope-hoist solves this, but this means the react-pdf import for primitives is being caught by parcel's tree shaking, which I believe should be considered a bug. Mainly not sure if this is an issue for here, or parcel currently.

@bryangottschalk
Copy link

Bless you @itswyll! This is the only answer that worked for me.

I'm not sure why these related issues are getting closed, I'm still having the same problem on the latest @react-pdf/renderer and Parcel without --no-scope-hoist or another hack.

@Devil7DK
Copy link

I'm also having the same issue

@diegomura diegomura added the bug label Feb 3, 2024
@yoonwaiyan
Copy link

I'm also having the same issue here

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

No branches or pull requests

5 participants