Closed KubukaH closed 2 years ago
Hi! I'd love to look into this. Could you share a reproduction repository with how you set up, and some steps for how to reproduce the error? That'd make it a lot easier for me to find out what's causing this.
Hi @Skn0tt , I edited the post in order to add the issues you requested.
Thank you
Thanks for updating! I think you missed some files (e.g. index.js
) - it might be easier to do this as a Github repository, and link it here.
@Skn0tt I have added you as a collaborator to my repo [kubuka-sub](https://github.com/KubukaH/kubuka-sub)
. If you would want some additional info I am available on email also kubukahub@gmail.com
.
Thank you
The steps you outlined are working fine for me - I cannot reproduce the error you're seeing locally. I'm not on Windows, though, so that might be a reason.
I see you're using Yarn 2, is there a specific reason for that? Yarn 2 does non-standard things to your module resolution, which might cause the problem you're seeing. Please try using NPM instead, and see if the error persists.
I am using Yarn 2 because I work with my code offline most of the time due to Data Bandwidth issues I am facing. Therefore I use Yarn 2 to be able to copy new files into a flash drive to my offline work environment, A desktop computer (if it was a laptop I wouldn't be doing this). Actually before I migrated to Yarn 2, I was using NPM and everything worked so fine.
But anyway, thank you for looking into this issue for me. I had thought perhaps there was a way I could bypass that error and continue using Yarn 2
. I will try to raise an issue with Yarn for assistance on dependency resolution. It seems Yarn is looking for react-netlify-identity.es.production.js
but Netlify is providing react-netlify-identity.cjs.production.min.js
. However, in this instance, react-netlify-identity.cjs.production.min.js
is installed but not being read correctly, and the code end up falling back to react-netlify-identity.es.production.js
, a non existent module. The question would therefore be, does Netlify provide this
react-netlify-identity.es.production.js
module or this react-netlify-identity.cjs.production.min.js
one.
Thank you
Thanks for elaborating! I think I see the problem, now: package.json
has a typo in the module
field. It says .es.production
, but the buildstep produces .esm.production
🤦 I'll open a PR and see how we can get this fixed.
Noted with thanks. I can't wait for the fix because I can't proceed to the next step in my development process.
I'm not sure how fast this PR will land, btw - talking to @sw-yx (former maintainer) about how we're publishing a new version. So this could take a week or two.
published on 0.2.6!
published on 0.2.6!
Thank you, let me update right away!
The error was fixed, however I think the there's another module again which needs to be fixed the same way. Here is the new error.
9 | "umd:main": "dist/react-netlify-identity.umd.production.js",
> 10 | "module": "dist/react-netlify-identity.esm.production.js",
> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ './dist/react-netlify-identity.esm.production.js' does not exist, did you mean './dist/react-netlify-identity.cjs.production.min.js'?'
11 | "typings": "dist/index.d.ts",
12 | "jsnext:main": "dist/index.es.js",
If you check, this time it's the .esm.
vs .cjs.
.
Could you try 0.2.7? 😅
Thank you @Skn0tt problem solved. 🤩
I am using Windows 10 OS, running a project using parcel@latest and
yarn init -2
and deploying the project to Netlify. My challenge is that I cannot usereact-netlify-identity
library for Identity strategy. The code crashes with the above stated error.Code
package.js
index.html
tailwind.config.js
.postcssrc
.parcelrc
ContextProvider.js
How it is behaving
@parcel/core: Failed to resolve 'react-netlify-identity' from './src/.../context/index.js'
C:\Users...\src\components\context\index.js:3:36 2 | import { useParams } from 'react-router-dom';
@parcel/resolver-default: Could not load './dist/react-netlify-identity.es.production.js' from module 'react-netlify-identity' found in package.json#module
C:\Users....yarn__virtual__\react-netlify-identity-virtual-92217ec8e4\0\cache\react-netlify-identity-npm-0.2.5-e3363cde5b-8b31bb74f9.zip\node_modules\react-netlify-identity\package.json:10:13 9 | "umd:main": "dist/react-netlify-identity.umd.production.js",
I hope this is not too long. It's my first time to post an error so I don't know the standard way of doing it or whether there are templates used.
Thank you