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
CJS module import is broken on latest #1468
Comments
+1, in my scenario Also
Long story short, this rewrite bellow works in
|
Facing this same issue. |
I came across this as well |
@martinschayna did you second snipped worked? I tried a couple things I either get Cannot find dnd-core or
|
Also I noticed that 9.3.3 has not been published for all packages. That seems a bit weird @darthtrevino ? |
I did some more digging around this, It appears that .d.ts are not patched, (not sure why at this point as the
I believe there's a missing rule in scripts/execute_cjs_replacements.js to replace imports in js files as well. So DndContext.js does not try to import from dnd-core in node_modules/react-dnd-cjs/lib/common/DndContext.js:11. let jsFromReplaceSpec = {
files: `${file}/lib/**/*.js`,
from: esmLibs.map(esmLib => new RegExp(`from '${esmLib}'`, 'g')),
to: esmLibs.map(esmLib => `from '${esmLib}-cjs'`),
}
replace.sync(jsFromReplaceSpec) |
Lame, I'll take a cut at fixing the release process. |
You just committed some abolute path : https://github.com/react-dnd/react-dnd/search?q=christrevino&unscoped_q=christrevino
|
I cleaned my repo and was able to run the build despite the tsconfig. Using yarn link I can have thing working but it seems that the published 9.3.5 packages still don't include the correct files. |
The CJS builds were always meant to be dynamically generated, so I'm not too worried about absolute paths in them. On |
@sandorfr what kinds of errors are you seeing after your build completes? |
I do see that the typings field is missing in the CJS - I'll do another release for that |
Just the error above #1468 (comment), but it was solved by cleaning my repo. I guess the yarn install I did then fixed it. The only remaining problem is that the 9.3.5 you published does not seem to include the changes when you inspect the tarball you still get the wrong imports. If I look at my locally built packages they are fine. |
I'm removing the absolute URLs from the create_packages script, it should be up in a minute |
@sandorfr The CJS packages are publishing now at 9.3.6 |
The contents of the npm install look okay, I must've misread something there. |
Ok trying it now :) |
Lerna must be setting up yarn links or something - give me a minute |
Thanks for your patience, I apologize for cutting a bunch of patches in a row. Those probably should have been prereleases. |
Thanks for the reactivity :) I know how painful this kind of issue are. So I can relate :) |
the correct version will be 9.3.8? |
9.3.9 hopefully - 9.3.8 doesn't have lib/ directories. Something was jacked up with how the prepublishOnly script was executing. |
9.3.9 looks good on my end |
@sandorfr yes, it works with given older versions of |
It does look good 💃. I will defintely know once the CI completes :) |
I'm out until the 20th - feel free to reopen this if the problem persists. Thanks! |
Can you publish on npm ? The lastest available is 9.3.4 as of today https://www.npmjs.com/package/react-dnd |
the fix in question only applies / affects cjs releases: https://www.npmjs.com/package/react-dnd-cjs |
Describe the bug
Latest CJS packages seem to be broken (9.3.3). Using 9.2.1 works. See codesandbox or the log below:
Reproduction
https://codesandbox.io/embed/wonderful-turing-mqywk
The text was updated successfully, but these errors were encountered: