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

Can't import the named export 'Picker' from non EcmaScript module #254

Closed
iMohamedSamir opened this issue Jul 26, 2022 · 4 comments
Closed

Comments

@iMohamedSamir
Copy link

I am keep having this error:

./node_modules/@selderee/plugin-htmlparser2/lib/hp2-builder.mjs
Can't import the named export 'Picker' from non EcmaScript module (only default export is available)

when I am using html-to-text to convert some raw html string.

I tried almost every single solution of both these issues: #229 reactioncommerce/reaction-component-library#399 but nothing worked, expect: reactioncommerce/reaction-component-library#399 (comment) which raised an entirely different error:
parseley__WEBPACK_IMPORTED_MODULE_4__.parse1 is not a function

Here are my dependencies, if it helps

  "dependencies": {
    "@apollo/client": "^3.6.2",
    "@reduxjs/toolkit": "^1.8.2",
    "@testing-library/jest-dom": "^5.16.4",
    "@testing-library/react": "^13.2.0",
    "@testing-library/user-event": "^13.5.0",
    "apollo-link-context": "^1.0.20",
    "draft-convert": "^2.1.12",
    "draft-js": "^0.11.7",
    "draftjs-to-html": "^0.9.1",
    "graphql": "^16.4.0",
    "html-to-text": "^8.2.0",
    "install": "^0.13.0",
    "jwt-decode": "^3.1.2",
    "moment": "^2.29.3",
    "npm": "^8.12.2",
    "react": "^17.0.1",
    "react-async": "^10.0.1",
    "react-dom": "^17.0.1",
    "react-draft-wysiwyg": "^1.15.0",
    "react-redux": "^8.0.2",
    "react-router-dom": "^5.3.1",
    "react-scripts": "^2.1.3",
    "semantic-ui-css": "^2.4.1",
    "semantic-ui-react": "^2.1.2",
    "web-vitals": "^2.1.4"
  },

any adives?

@KillyMXI
Copy link
Member

See #230

Your links mention config paths specific to certain types of projects.
You have to figure out where is the webpack config should be in your project.

@iMohamedSamir
Copy link
Author

I was creating webpack.config.js in the root folder, right beside config.json but it had to effect, only when I added the rule manually to node_modules\react-scripts\config\webpack.config.js it worked and I got ride of the error I have another another one: parseley__WEBPACK_IMPORTED_MODULE_4__.parse1 is not a function toAstTerminalPairs projectPath/node_modules/selderee/lib/selderee.mjs:154 this time the error is only in the component which I am using html-to-text in.
It's not my first time seeing this error, I had it yesterday when I was trying the previously mentioned solutions. but I though react-app-rewired caused it.

But the error appears even if am not using react-app-rewired.

I think I am ready to give up now, I will try to RegEx the hell out my raw html lol.

@KillyMXI
Copy link
Member

KillyMXI commented Jul 27, 2022

I'm sorry for all the trouble.
Real life interfere with all my development plans.

You can try the version 7.1.1 - it lacks some features but it should be free of this issue.
Perhaps I can release 7.1.2 quickly to resolve audit issues there.

I'll think whether I can break the grand release of v9 into parts to get the feedback on it earlier.
(I expect it might solve this issue but I'm not sure.)

P.S. https://stackoverflow.com/a/1732454/3423843

@KillyMXI
Copy link
Member

KillyMXI commented Dec 3, 2022

Version 9 is now public.
Based on little feedback I've got in #252, webpack issue should be fixed now.
Please open a new issue in case there is any problem with version 9.

@KillyMXI KillyMXI closed this as completed Dec 3, 2022
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