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

Error "cannot use import statement outside a module" with React #63

Open
thisistaimur opened this issue Jun 3, 2021 · 7 comments
Open

Comments

@thisistaimur
Copy link

thisistaimur commented Jun 3, 2021

Getting an error when importing the module into a React script. Same works fine in a Node app or plain HTML. Does anyone have a fix?

Screen Shot 2021-06-03 at 12 23 41
Screen Shot 2021-06-03 at 12 23 22

@Georgegriff
Copy link
Contributor

This is because this module ships as native modules and the React ecoystem is some what legacy in this respect,

I've got a PR to try to address this but i havent had time to test it properly, and would need to be a breaking change.

https://github.com/Georgegriff/query-selector-shadow-dom/pull/53/files

If you want to experiment with this you should be able to change your package.json entry for this package to:

"query-selector-shadow-dom": "git://Georgegriff/query-selector-shadow-dom.git#consider_essm"

If you have any time to help contribute/test t would be appreciated

@thisistaimur
Copy link
Author

Cheers, will look into it and definitely contribute if I come up with a solution :)

@JohnHardy
Copy link

Did this solution get implemented? Is there a fork that can be used instead?

Thanks!

@Georgegriff
Copy link
Contributor

There isn't I would be open to contributions I started a pr but didn't get around to following it up, not sure when I will next get a chance to investigate #53

@JohnHardy
Copy link

Thanks for your time following up with me - I really appreciate it. Sorry, I thought the PR above was fully finished.

@kazaff
Copy link

kazaff commented Aug 29, 2022

This is because this module ships as native modules and the React ecoystem is some what legacy in this respect,

I've got a PR to try to address this but i havent had time to test it properly, and would need to be a breaking change.

https://github.com/Georgegriff/query-selector-shadow-dom/pull/53/files

If you want to experiment with this you should be able to change your package.json entry for this package to:

"query-selector-shadow-dom": "git://Georgegriff/query-selector-shadow-dom.git#consider_essm"

If you have any time to help contribute/test t would be appreciated

Could you tell me the mean of "change your package.json entry"?

@jiefugong
Copy link

Bump on this -- also running into this issue!

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