-
Notifications
You must be signed in to change notification settings - Fork 19
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
Fix import path in React.Basic.DOM.Server JS #38
Conversation
It does seem that the file extension is required here.
After these changes, I see no errors
|
Huh that's very weird. I can work on a hotfix release tomorrow. I'm only on my phone but any idea why this isn't being picked up by the GitHub actions? |
I'm still not sure why this is, but it seems like there is a difference between how Node resolves CJS modules vs ESM modules: According to the Node ESM docs
So CommonJS import without extension succeeds
and ESM import with extension succeeds
but ESM without extension fails
If I add an "exports": {
".": "./index.js",
"./server": "./server.js"
} then ESM without extension works
|
" 1 workflow awaiting approval |
Sorry I meant why the existing checks didn't catch this error, since Pete was able to reproduce it so easily. I can take a look at them in the morning. Thanks for this PR |
I can't say that I understand the ES6 module system all that well. After some combination of yarn upgrades and yarn installs, the current version in master started working with our project and my version broke with
I'd just close my PR but since you reproduced my original issue, I don't know what's up with this then. I'd advise against using my PR at least. |
It seems like |
Seems there was an exports field added recently: facebook/react#23252 |
It looks like the problem is probably due the fact that the current package.json expects ^17.0.0 of react-dom and that export was added in ^18.0.0. This is a bit tricky, I think the correct thing would be to fix this using the change in the PR, but it sounds like that will break for 18, then do a new version for React 18 (most of the react-basic does not yet support React 18) |
This would be my recommendation - #39. Merge that and release as 5.0.1, then we can do a 6.0.0 for React 18 |
5.0.1 released - https://github.com/lumihq/purescript-react-basic-dom/releases/tag/v5.0.1. Thanks for reporting this! |
The string in import statement in Server.js is a path and it requires the file suffix as well.