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

Runtime error in development builds but not production #9450

Closed
cgauld opened this issue Dec 19, 2023 · 5 comments
Closed

Runtime error in development builds but not production #9450

cgauld opened this issue Dec 19, 2023 · 5 comments

Comments

@cgauld
Copy link

cgauld commented Dec 19, 2023

I've got an interesting case of a project that has a runtime error in development builds but not production builds. I've been able to create a minimal example that demonstrates the issue:
Archive.zip

It's triggered in this project using the React Markdown library. Doing a bit of digging into it I do believe it's a Parcel bug although my understanding of the workings of Parcel mean that I can't be 100% sure. It looks like there's an issue with a dependency chain that should resolve to a const exported from a module within a package. In development mode, the const ends up undefined, and indeed no source map for the module appears in the browser at runtime. Here's the stack trace:

index.js:874 Uncaught TypeError: Cannot read properties of undefined (reading 'href')
    at createProperty (index.js:874:20)
    at createElementProps (index.js:691:22)
    at element (index.js:439:17)
    at one (index.js:391:12)
    at createChildren (index.js:823:20)
    at element (index.js:440:18)
    at one (index.js:391:12)
    at createChildren (index.js:823:20)
    at root (index.js:560:22)
    at one (index.js:407:12)
    at toJsxRuntime (index.js:361:18)
    at Markdown (index.js:225:21)
    at renderWithHooks (react-dom.development.js:16305:18)
    at mountIndeterminateComponent (react-dom.development.js:20074:13)
    at beginWork (react-dom.development.js:21587:16)
    at beginWork$1 (react-dom.development.js:27426:14)
    at performUnitOfWork (react-dom.development.js:26557:12)
    at workLoopSync (react-dom.development.js:26466:5)
    at renderRootSync (react-dom.development.js:26434:7)
    at recoverFromConcurrentError (react-dom.development.js:25850:20)
    at performConcurrentWorkOnRoot (react-dom.development.js:25750:22)
    at workLoop (scheduler.development.js:266:34)
    at flushWork (scheduler.development.js:239:14)
    at MessagePort.performWorkUntilDeadline (scheduler.development.js:533:21)

Note, this package has a dependency that requires the Parcel setting for supporting package exports - not sure if that's related or not:

  "@parcel/resolver-default": {
    "packageExports": true
  }

I've been able to replicate this issue both with 2.10.3 and 2.9 (the first version to support package exports).

@AntonKrutikov
Copy link

Same behaviour for me, not found cause for now.

@ManishMadan2882
Copy link

Facing same issues in React Markdown only with Parcel.

@will8211
Copy link

Facing this as well. Does anyone know of a workaround?

Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.

@github-actions github-actions bot added the Stale Inactive issues label Oct 12, 2024
@Joeoeoe
Copy link

Joeoeoe commented Nov 2, 2024

Facing this as well

@github-actions github-actions bot removed the Stale Inactive issues label Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants