Closed huangxiaobao-cxx closed 5 months ago
Thanks for the report @huangxiaobao-cxx & glad you got it working!
https://www.npmjs.com/package/cross-env#usage
Shouldn't need set
according to cross-env docs. Which terminal are you using?
Also, I don't see the errant ;
in the build:dev
command here on main
Found it, the semicolon is on the "dev": "pnpm run build:dev; onchange 'src/**/*.rs' -- pnpm run build:dev",
command.
thanks
@huangxiaobao-cxx please pull from main & close this issue if your problem is solved :pray:
https://github.com/CADmium-Co/CADmium/commit/44b051b26f91b70c5cef6898fcd876ef812ebb74
Thanks for the report @huangxiaobao-cxx & glad you got it working!
https://www.npmjs.com/package/cross-env#usage
Shouldn't need
set
according to cross-env docs. Which terminal are you using?Also, I don't see the errant
;
in thebuild:dev
command here on main
I tested it using cmd, powershell, and bash terminals, but still couldn't run "pnpm dev" and it would prompt that RUST_BACKTRACE could not be recognized
From the website https://www.npmjs.com/package/cross-env#usage, I found that the "cross-env" instruction sets the environment variables at the beginning, so I tried to modify the script and change the "build:dev" instruction from
build:dev: cross-env cargo check && RUST_BACKTRACE=1 wasm-pack build --no-pack --target web --dev
to
build:dev: cross-env RUST_BACKTRACE=1 cargo check && wasm-pack build --no-pack --target web --dev
After the modification, executing "pnpm dev" can run successfully
@huangxiaobao-cxx Please try this: "build:dev": "cross-env cargo check && set RUST_BACKTRACE=1 wasm-pack build --no-pack --target web --dev",
@huangxiaobao-cxx Please try this:
"build:dev": "cross-env cargo check && set RUST_BACKTRACE=1 wasm-pack build --no-pack --target web --dev",
Yes, that works successfully!.
@av8ta You can also try this: "build:dev": "cross-env RUST_BACKTRACE=1 cargo check && wasm-pack build --no-pack --target web --dev"
, this also works successfully!
thanks!
@MattFerraro you're on apple? Assume pnpm dev
runs fine like this on main branch? All good on linux & windows.
yes, pnpm dev
works for me on my M1 macbook!
I encountered 3 problems when compiling according to the readme document. The first problem is that when executing the "pnpm dev" command, the console output is as follows: Observing the above error, it seems that there is an extra ";" in the command, so I found the "dev" script in "packages/cadmium/package.json" and found that there is indeed an extra ";" in the command. After I deleted it, the error disappeared. But when executing "pnpm dev" again, the second problem appeared: The command RUST_BACKTRACE terminal cannot recognize it. After consulting the information, I found that the command is to set the RUST environment variable, but setting the environment variable in the Windows terminal requires "set", so I changed RUST_BACKTRACE=1 to set RUST_BACKTRACE=1, and ran it again, and the error disappeared. After modifying "packages/cadmium/package.json", part of its content is: After running "pnpm dev" again, the third problem occurred: the console cannot output UTF-8 text, and the program crashes. Here, you only need to modify the console encoding and execute "chcp 65001". Run "pnpm dev" again and it will be executed successfully. The cadmium web interface is as follows: