英文:
unable to import local wasm npm package in shadow-cljs project
问题
我正在尝试在我的shadow-cljs项目中导入wasm包,它被捆绑在一个npm包中,但我一直遇到这个错误:
所需的JS依赖项 "canvas" 不可用,它是由 "canvas/core.cljs" 所需的。
这是我的项目结构:
. <- rust包的根目录
├── canvas
│ ├── env
│ ├── node_modules
│ │ ├── ...
│ │ ├── canvas -> ../../pkg <- 我的本地包
│ │ └── ...
│ ├── resources
│ ├── src
│ └── target
├── pkg <- 我的本地包
├── src
├── target
└── tests
这是我的package.json(来自ClojureScript项目):
{
"devDependencies": {
"shadow-cljs": "^2.8.83"
},
"dependencies": {
"canvas": "file:../pkg",
"create-react-class": "^15.6.3",
"react": "^16.4.0",
"react-dom": "^16.4.0"
}
}
我运行了 npm install
并在我的项目中像这样添加了canvas模块(在core.cljs中):
(ns canvas.core
(:require
...
["canvas" :as canvas]))
这里似乎有什么问题?
英文:
I am playing arounf trying to import wasm packages in my shadow-cljs project. It is bundled in a npm package, but i keep getting this error:
The required JS dependency "canvas" is not available, it was required by "canvas/core.cljs".
this is my project structure:
. <- root of the rust crate
├── canvas
│   ├── env
│   ├── node_modules
│   │   ├── ...
│   │   ├── canvas -> ../../pkg <- my local package
│   │   └── ...
│   ├── resources
│   ├── src
│   └── target
├── pkg <- my local package
├── src
├── target
└── tests
and this is my package.json (from the clojurescript project):
{
"devDependencies": {
"shadow-cljs": "^2.8.83"
},
"dependencies": {
"canvas": "file:../pkg",
"create-react-class": "^15.6.3",
"react": "^16.4.0",
"react-dom": "^16.4.0"
}
}
I ran npm install
and added the canvas module to my project like so (in core.cljs):
(ns canvas.core
(:require
...
["canvas" :as canvas]))
What seems to be the problem here??
答案1
得分: 0
WebAssembly "bundling"不受shadow-cljs支持。
英文:
WebAssembly "bundling" is not supported by shadow-cljs.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论