Comments (9)
Ok, I kinda trust you but I wasn't able to reproduce the problem with a clean https://github.com/pmndrs/react-three-next initialization with the "untouched" library
and a yarn build produced no error
@CodyJasonBennett can you confirm this would fix the problem? or point me to a reproducibility procedure? I'm the kind of guy that likes to avoids "blind fixes" if possible
from gainmap-js.
v3.0.5 is out https://publint.dev/@monogrid/[email protected] seems fine, let me know if this solves this problem, thanks for the help!
from gainmap-js.
is this solved by adding something like this?
"exports": {
".": {
"import": "./dist/decode.js",
"main": "./dist/decode.umd.js", <----------
"types": "./dist/decode.d.ts"
},
"./encode": {
"import": "./dist/encode.js",
"main": "./dist/encode.umd.js", <----------
"types": "./dist/encode.d.ts"
},
"./libultrahdr": {
"import": "./dist/libultrahdr.js",
"main": "./dist/libultrahdr.umd.js", <----------
"types": "./dist/libultrahdr.d.ts"
},
"./worker": {
"import": "./dist/worker.js",
"main": "./dist/worker.umd.js", <----------
"types": "./dist/worker.d.ts"
},
"./worker-interface": {
"import": "./dist/worker-interface.js",
"main": "./dist/worker-interface.umd.js", <----------
"types": "./dist/worker-interface.d.ts"
}
},
I'm not sure what's the proper fix, I have no trouble bundling with vite
from gainmap-js.
or maybe I need to name the files .mjs
[...]
"exports": {
".": {
"import": "./dist/decode.mjs",
[...]
}
[...]
🤔
I'm trying to reproduce the problem with https://github.com/pmndrs/react-three-next
from gainmap-js.
good idea! i hope this is just a fluke. esm exports package.json is so complicated, i would not know how to even publish a package nowadays.
from gainmap-js.
See https://publint.dev/@monogrid/[email protected]. It should be (note the use of .cjs
):
"main": "dist/decode.umd.cjs",
"module": "dist/decode.js",
"types": "dist/decode.d.ts",
"sideEffects": false,
"type": "module",
"exports": {
".": {
"types": "./dist/decode.d.ts",
"import": "./dist/decode.js",
"default": "./dist/decode.umd.cjs"
},
"./encode": {
"types": "./dist/encode.d.ts",
"import": "./dist/encode.js",
"default": "./dist/encode.umd.cjs"
},
"./libultrahdr": {
"types": "./dist/libultrahdr.d.ts",
"import": "./dist/libultrahdr.js",
"default": "./dist/libultrahdr.umd.cjs"
},
"./worker": {
"types": "./dist/worker.d.ts",
"import": "./dist/worker.js",
"main": "./dist/worker.umd.cjs"
},
"./worker-interface": {
"types": "./dist/worker-interface.d.ts",
"import": "./dist/worker-interface.js",
"default": "./dist/worker-interface.umd.js"
}
},
from gainmap-js.
The reason this issue occurred was because Node tried to resolve your package from a CJS entrypoint (Next.js server-side), but the package only specifies the import
condition (ESM-only). Since Node 14, it reads from the exports
field over main
when present (module
is a Webpack-only field).
The use of .cjs
or .mjs
overrides the type
key which controls which resolver Node should use for .js
extensions. So, for an ESM package with "type": "module"
, you can use .cjs
to specify a CJS entrypoint, and anything ending with .js
is assumed to be ESM.
I couldn't clone this repository to implement this fix myself, but was referred here due to a downstream issue when resolving with Next.js, presumably through their app directory which uses a different compiler than our Next.js integration tests. https://publint.dev exists and can be used locally via CLI to ensure your package satisfies Node's increasingly complicated API contract.
from gainmap-js.
Okay then, I've opened #36 with the fix you proposed, will be merging soon
from gainmap-js.
I'm going to close this as no-one else reported a similar problem. If this problem resurfaces please feel free to open again, thanks everyone
from gainmap-js.
Related Issues (19)
- sdrJPEG from Loader for custom shader skybox HOT 2
- Artifact in converted .hdr HOT 8
- Decoder hang with invalid URL HOT 4
- peerDependencies < 0.159.0 HOT 3
- ios 14 webgl1 HOT 5
- Can't build the project HOT 1
- encodeJPEGMetadata failed: Object in bad state, mem alloc failed HOT 9
- Confusion about gainmap-js HOT 6
- .setRenderer(gl) on the LoaderBase class HOT 1
- Docs for encoding seem out of date? HOT 2
- Put decoder library on npm or CDN link for easy import
- Is it possible to use hdrjpg's with Scene.BackgroundRotation and Scene.BackgroundBluriness in threejs? HOT 3
- HDRJPGs with resolutions higher than 4K crash on mobile (iOS iPhone 15) HOT 3
- Kudos to you - Readme suggestion HOT 3
- Uploading file with .hdr.jpg extension online encoder fails HOT 2
- using encode wasm libultrahdr with node HOT 2
- [Bug] Not working with WebGPURenderer HOT 2
- Support for WebGPU Renderer HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gainmap-js.