-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fs-extra 模块不能正常使用 #4732
Comments
跟 egg 没什么关系,报错堆栈都打印出来了,自己断点查查 |
我业务代码其他都没问题,除了引用下这个库;这个库7.9kstar,我新建一个基础的nodejs项目用的话,也没啥问题; |
请提供一个最小可复现代码库,提供后可以 reopen 本 issue |
https://drive.google.com/file/d/1Je_eyR-AlXGOIfWW8-zdQO1GJg7ffrsf/view?usp=sharing fs-extra 在 app controller editor project里 |
Hello @pxim. Please provide a reproducible example following the instruction. Issues labeled by 如果在 7 天内没有进展会被自动关闭。 |
按这个来,提交到 GitHub 个人仓库 |
https://github.com/pxim/res-web3d-editor-server-egg-pkg |
复现方式? |
|
试了,是正常的。 看到你的依赖有 pkg 打包的,怀疑跟它有关,你可以试着 rm 掉 node_modules 后再试试。 |
我用egg-examples里的案例测试是正常的,但是在我项目环境里出错; 我 删掉 node_modules ,然后又重新安装了,还是不行;算了,我不用这个库了; |
提供不了稳定复现方式,我们也没法解决。 从原理上来想都不可能跟 egg 有关,而且错误堆栈都出来了,其实你断点下几分钟就能知道问题了。 我猜测大概率跟 pkg 构建的产物干扰有关。 |
我用egg init新建了一个工程,然后把pkg的配置原样拷过去,业务代码拷过去,fs-extra 可以正常使用了,其他功能也都正常; 至于为什么以前的不能用,就不清楚了 |
What happens?
https://github.com/jprichardson/node-fs-extra
这个模块在egg里用不了,
How To Reproduce
Steps to reproduce the behavior:
1.
一旦添加红框中的代码,运行dev,直接报错
去掉红框里的代码,运行dev,就ok正常。
package.json
{ "private": true, "version": "1.5.1", "description": "Preview glTF models using three.js and a drag-and-drop interface.", "author": "Don McCurdy <[email protected]> (https://www.donmccurdy.com)", "license": "MIT", "main": "public/app.js", "proxy": "http://127.0.0.1:801", "targets": { "main": { "engines": { "browsers": [ "> 1%", "not dead" ] } } }, "staticFiles": { "staticPath": [ { "staticPath": "assets", "staticOutDir": "assets" } ] }, "scripts": { "build": "parcel public index.html --public-url . --out-dir public", "build:registry": "curl https://rawgit.com/KhronosGroup/glTF-Generator-Registry/master/registry.json -o lib/gltf-generator-registry.json", "dev": "parcel index.html --port 3000", "test": "node scripts/gen_test.js", "deploy": "npm run build && vercel --local-config vercel.json --prod", "postversion": "git push && git push --tags" }, "dependencies": { "axios": "^0.21.1", "can": "^6.6.1", "dat.gui": "^0.7.7", "glob-to-regexp": "^0.4.1", "glsl-blend-soft-light": "^1.0.5", "glsl-film-grain": "^1.0.4", "gltf-validator": "^2.0.0-dev.3.3", "handlebars": "^4.7.6", "jquery": "^3.6.0", "query-string": "^7.0.0", "simple-dropzone": "^0.8.1", "three": "^0.129.0" }, "devDependencies": { "glslify-bundle": "^5.1.1", "glslify-deps": "^1.3.2", "node-fetch": "^2.6.1", "parcel-bundler": "^1.12.4", "parcel-plugin-static-files-copy": "^2.5.0" } }
Expected behavior
1.
2.
Context
The text was updated successfully, but these errors were encountered: