-
Notifications
You must be signed in to change notification settings - Fork 24
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
Webcrypto import errors in 0.29.1 #318
Comments
I'm able to fix issues with parcel and webpack with this commit: fission-codes/one-webcrypto@a95b889 CRA remains a problem. I'm not sure why it can't import webcrypto at all 🤪 |
"Progress" on CRA: Directly importing Importing files within one-webcrypto seems to fix the issue. That is:
So it seems like react-scripts just fail to resolve the correct file given |
Okay, more updates. I removed the Then I added various forms of
When I run this: import oneWC from "one-webcrypto"
console.log(oneWC) It just prints |
Since
I really want to get 0.29.1 out there, and I still think one-webcrypto is an improvement over what we had before, because now we can use parts of keystore-idb and webnative in nodejs and it might open the door for sveltekit. It also makes it easier for new libraries (e.g. ucans) to adopt webcrypto in a way such that they're already quite "isomorphic" out of the box and in the future we can change one-webcrypto in one place and everyone benefits. What do you think? |
I think the benefits outweigh support for CRA. A future release of CRA might use webpack 5 or another bundler, and we could re-evaluate it then. Create React App is by their own admission slow to release new versions. In the meantime, we can recommend Vite, Parcel, and Webpack 5, and we have good examples of how to migrate from CRA to these bundlers in the React TodoMVC repository. |
I may have prematurely closed this issue, because we may need a new version of |
We have a new version of |
Closing this, because #321 is merged now. |
Summary
Problem
webcrypto
cannot be imported or isundefined
with some bundlers/build tools with webnative0.29.1
.Impact
Some applications will not be able to use webnative at
0.29.1
, depending on the build system or bundler they use if any.Solution
Unknown. The issue appears to be related to the change over to
one-webcrypto
and there may be something we can change there.Detail
Describe the bug
Parcel 2, Webpack 5, and Create React App report errors in the console. (See the screenshots below.)
To Reproduce
Steps to reproduce the behavior:
npm start
for local dev andnpm run build
for a build in eachparcel
,webpack
, andmain
branches should fail (main is CRA)Expected behavior
No errors in the console. The app works and can do TodoMVC things.
Screenshots
CRA local development
CRA build (fails at build time)
Parcel 2 local development
Parcel 2 build
Webpack 5 local development and build
The text was updated successfully, but these errors were encountered: