You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the Issue
When using KaibanJS in a Node.js project with "type": "module" specified in package.json, attempting to use import statements to load the library results in an error indicating a missing react dependency. Even after installing react, the error persists. However, switching to require resolves the issue.
Steps to Reproduce
Create a Node.js project with "type": "module" in the package.json file.
Install kaibanjs and other necessary dependencies.
Use import statements to include KaibanJS modules.
Observe the error indicating that react is missing.
Switch to require instead of import, and notice the issue is resolved.
Current vs. Expected Behavior
Current Behavior: Using import in a Node.js environment with "type": "module" triggers an error related to react.
Expected Behavior: The library should work seamlessly with import syntax without requiring react or other unnecessary dependencies in a Node.js environment.
Environment
Node.js Version: [e.g., 18.x]
KaibanJS Version: [e.g., 0.1.0]
JavaScript Runtime: [Node.js with ESM support]
Possible Cause
The issue might stem from the assumption that ES6 module compilation is intended for browser environments only, where react is a required dependency. This could have led to unintended behavior when using the library in Node.js environments.
The text was updated successfully, but these errors were encountered:
Thank you for looking into this, the issue is indeed with the version of node, I am using v18.20.5, but testing it with v20.10.0 both .cjs and .js versions work where with node v18.20.5 only the .cjs version works and the .js version throws the react error:
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'react' imported from /Users/martinkunft/dev/ai/testing/KaibanJS/playground/nodejs-esm/node_modules/kaibanjs/dist/bundle.mjs
at packageResolve (node:internal/modules/esm/resolve:844:9)
at moduleResolve (node:internal/modules/esm/resolve:901:20)
at defaultResolve (node:internal/modules/esm/resolve:1121:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:396:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:365:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:240:38)
at ModuleWrap. (node:internal/modules/esm/module_job:85:39)
at link (node:internal/modules/esm/module_job:84:36) {
code: 'ERR_MODULE_NOT_FOUND'
}
Describe the Issue
When using KaibanJS in a Node.js project with
"type": "module"
specified inpackage.json
, attempting to useimport
statements to load the library results in an error indicating a missingreact
dependency. Even after installingreact
, the error persists. However, switching torequire
resolves the issue.Steps to Reproduce
"type": "module"
in thepackage.json
file.kaibanjs
and other necessary dependencies.import
statements to include KaibanJS modules.react
is missing.require
instead ofimport
, and notice the issue is resolved.Current vs. Expected Behavior
import
in a Node.js environment with"type": "module"
triggers an error related toreact
.import
syntax without requiringreact
or other unnecessary dependencies in a Node.js environment.Environment
Possible Cause
The issue might stem from the assumption that ES6 module compilation is intended for browser environments only, where
react
is a required dependency. This could have led to unintended behavior when using the library in Node.js environments.The text was updated successfully, but these errors were encountered: