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

Parcel breaks when import react-syntax-highlighter #1028

Closed
arivanandan opened this issue May 15, 2021 · 1 comment
Closed

Parcel breaks when import react-syntax-highlighter #1028

arivanandan opened this issue May 15, 2021 · 1 comment
Labels
kind: support Asking for support with something or a specific use case scope: templates Related to an init template, not necessarily to core (but could influence core) solution: out-of-scope This is out of scope for this project

Comments

@arivanandan
Copy link

arivanandan commented May 15, 2021

Current Behavior

This is with tsdx watch.
Importing libraries such as remark-prism or react-syntax-highlighter breaks the app. I don't see anything in the console. All I see is a white screen. If I delay the import (remove it from being a top level import), make it a require inside application logic and try to console log it, it breaks after that. The react root disappears (guessing this is what happens when React breaks) but tsdx is unable to show me the react errors that pop?

Expected behavior

These plugins / libraries work with a normal React project / CRA installation.

Suggested solution(s)

Something with imports / ESM modules maybe?
No clue what's happening. Would love to provide additional information when I know where to look.

Additional context

I'm not running anything special. Ultimately, I'd be using these with react-markdown, but these imports break the app outside, before I can get them inside react-markdown. This is probably irrelevant.

Your environment

  System:
    OS: Linux 5.8 Ubuntu 20.04.2 LTS (Focal Fossa)
    CPU: (8) x64 Intel(R) Core(TM) i5-9300H CPU @ 2.40GHz
    Memory: 3.90 GB / 15.49 GB
    Container: Yes
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 14.15.1 - ~/.nvm/versions/node/v14.15.1/bin/node
    Yarn: 1.22.10 - /usr/bin/yarn
    npm: 6.14.8 - ~/.nvm/versions/node/v14.15.1/bin/npm
  Browsers:
    Chrome: 90.0.4430.93
    Firefox: 88.0.1
  npmPackages:
    tsdx: ^0.14.1 => 0.14.1 
    typescript: ^4.1.2 => 4.2.4 
  npmGlobalPackages:
    typescript: 4.1.2
@arivanandan
Copy link
Author

This has something to do with how parcel bundles and one of react-syntax-highlighter's requires

swagger-api/swagger-ui#6285
parcel-bundler/parcel#3176

@agilgur5 agilgur5 changed the title app breaks with certain external modules Parcel breaks when import react-syntax-highlighter Apr 11, 2022
@agilgur5 agilgur5 added kind: support Asking for support with something or a specific use case solution: out-of-scope This is out of scope for this project scope: templates Related to an init template, not necessarily to core (but could influence core) labels Apr 11, 2022
Repository owner locked as off-topic and limited conversation to collaborators Apr 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind: support Asking for support with something or a specific use case scope: templates Related to an init template, not necessarily to core (but could influence core) solution: out-of-scope This is out of scope for this project
Projects
None yet
Development

No branches or pull requests

2 participants