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

Attempted import error: parse5 #288

Closed
avalero opened this issue Nov 9, 2021 · 6 comments
Closed

Attempted import error: parse5 #288

avalero opened this issue Nov 9, 2021 · 6 comments

Comments

@avalero
Copy link
Contributor

avalero commented Nov 9, 2021

I am getting this error when y try to yarn run build a create-react-app that uses react-md-editor.

Attempted import error: 'parse5/lib/parser/index.js' does not contain a default export (imported as 'Parser').

This dependency comes from react-md-editor package through /node_modules/hast-util-raw/lib/index.js

Running in dev mode with yarn run dev or yarn run start works just right

I am using React 17.

@jaywcjlove
Copy link
Member

Give me an example to test it?
@avalero

@avalero
Copy link
Contributor Author

avalero commented Nov 9, 2021

Hi @jaywcjlove , I just gave you access to my repository.
Just run yarn install on root directory and yarn run build on packages/cms/

@jaywcjlove
Copy link
Member

@avalero I seem to have rejected it. :(

@avalero
Copy link
Contributor Author

avalero commented Nov 10, 2021

Hi @jaywcjlove I invited you again

@jaywcjlove
Copy link
Member

@avalero The configuration of your react-app-rewired tool is wrong.

packages/cms/config-overrides.js

const path  = require('path');

// config-overrides.js
module.exports = function override(config, env) {
  // This line might break with other react-script versions
-  delete config.module.rules[1].oneOf[2].include
+  config.module.rules[1].oneOf[2].include = [
+    config.module.rules[1].oneOf[2].include,
+    path.resolve(process.cwd(), '..', 'common', 'src'),
+  ]
  return config
}

@avalero
Copy link
Contributor Author

avalero commented Nov 10, 2021

Amazing @jaywcjlove , thanks!!

@avalero avalero closed this as completed Nov 10, 2021
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

2 participants