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
I recently ran into an issue i wanted to take time to debug because i really wanted to use jodit in my Next.js project and i wanted to check if the demo could reproduce the same issue outside of Next or if it would be easier to debug with the repo locally - so this is why this is a problem if the repo cannot be run in different environments. These fixes allowed me to run and find the issue and open PR for it as well as these build fixes.
Opening this issue to link to PR.
The PR fixes 3 issues listed below with desscriptions of the type of errors they throw in another environment i.e. Windows
These issues prevent the contributor or user from running any of these scripts (or the demo ones but thats split out to a different PR) npm run build npm run build:types npm run remove-css
Using NODE_ENV instead of cross-env NODE_ENV is OS incompatible. cross-env makes it OS compatible which is good for a project that benefits from many contributors
[email protected] build:react
NODE_ENV=production node -r @swc-node/register ./node_modules/.bin/webpack --mode production
'NODE_ENV' is not recognized as an internal or external command,
operable program or batch file.
Running npm run build:types broken
Threw an error due to issue with remove-css - this is a simple fix in package.json
Also could not build due to "skipLibCheck": true missing in tsconfig.types.json - threw errors about every .d.ts file, recommended to set to true so will be able to run build
Error: ENOENT: no such file or directory, lstat 'C:\Users\user\jodit-react\build**.ts'
at Object.lstatSync (node:fs:1633:25)
at replacizeFileSync (C:\Users\user\jodit-react\node_modules\replace\replace.js:140:22)
at module.exports (C:\Users\user\jodit-react\node_modules\replace\replace.js:80:17)
at Object. (C:\Users\user\jodit-react\node_modules\replace\bin\replace.js:42:1)
at Module._compile (node:internal/modules/cjs/loader:1358:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
at Module.load (node:internal/modules/cjs/loader:1208:32)
at Module._load (node:internal/modules/cjs/loader:1024:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
at node:internal/main/run_main_module:28:49 {
errno: -4058,
code: 'ENOENT',
syscall: 'lstat',
path: 'C:\Users\user\jodit-react\build\**\.ts'
}
Running npm run build broken (below)
This is what happens when using this ./node_modules/.bin/webpack in Windows env (below)
Fixed by updating webpack.config to .js and package.json (adding webpack script that allows webpack to run correctly in any environment) This allows npm run build:types and npm run build runs successfully.
C:\Users\user\jodit-react\node_modules.bin\webpack:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\,/,g')")
^^^^^^^
SyntaxError: missing ) after argument list
at wrapSafe (node:internal/modules/cjs/loader:1281:20)
at Module._compile (node:internal/modules/cjs/loader:1321:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
at Object.newLoader [as .js] (C:\Users\user\jodit-react\node_modules\pirates\lib\index.js:121:7)
at Module.load (node:internal/modules/cjs/loader:1208:32)
at Function.Module._load (node:internal/modules/cjs/loader:1024:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
at node:internal/main/run_main_module:28:49
Node.js v20.13.1
The text was updated successfully, but these errors were encountered:
lari-ks
added a commit
to lari-ks/jodit-react
that referenced
this issue
Jan 28, 2025
Unable to run repo on a Windows or other OS.
Use Case for Proposal
I recently ran into an issue i wanted to take time to debug because i really wanted to use jodit in my Next.js project and i wanted to check if the demo could reproduce the same issue outside of Next or if it would be easier to debug with the repo locally - so this is why this is a problem if the repo cannot be run in different environments. These fixes allowed me to run and find the issue and open PR for it as well as these build fixes.
Opening this issue to link to PR.
The PR fixes 3 issues listed below with desscriptions of the type of errors they throw in another environment i.e. Windows
These issues prevent the contributor or user from running any of these scripts (or the demo ones but thats split out to a different PR)
npm run build
npm run build:types
npm run remove-css
NODE_ENV
instead ofcross-env NODE_ENV
is OS incompatible. cross-env makes it OS compatible which is good for a project that benefits from many contributorsnpm run build:types
brokenThrew an error due to issue with
remove-css
- this is a simple fix in package.jsonAlso could not build due to
"skipLibCheck": true
missing in tsconfig.types.json - threw errors about every .d.ts file, recommended to set to true so will be able to run buildnpm run build
broken (below)This is what happens when using this
./node_modules/.bin/webpack
in Windows env (below)Fixed by updating webpack.config to .js and package.json (adding webpack script that allows webpack to run correctly in any environment)
This allows
npm run build:types
andnpm run build
runs successfully.The text was updated successfully, but these errors were encountered: