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
error - Error: Mock file D:\Doit\web\umijs-antd-pro\mock\demo.ts parse failed.
Cannot find module '@/constants/requestUrl'
Require stack:
- D:\Doit\web\umijs-antd-pro\mock\demo.ts
- D:\Doit\web\umijs-antd-pro\node_modules\.pnpm\@umijs+preset-umi@4.0.71_lyjbtud22co2ahpp6zb6tamdfe\node_modules\@umijs\preset-umi\dist\features\mock\getMockData.js
- D:\Doit\web\umijs-antd-pro\node_modules\.pnpm\@umijs+preset-umi@4.0.71_lyjbtud22co2ahpp6zb6tamdfe\node_modules\@umijs\preset-umi\dist\features\mock\mock.js
- D:\Doit\web\umijs-antd-pro\node_modules\.pnpm\@umijs+core@4.0.71\node_modules\@umijs\core\dist\service\plugin.js
- D:\Doit\web\umijs-antd-pro\node_modules\.pnpm\@umijs+core@4.0.71\node_modules\@umijs\core\dist\service\pluginAPI.js
- D:\Doit\web\umijs-antd-pro\node_modules\.pnpm\@umijs+core@4.0.71\node_modules\@umijs\core\dist\index.js
- D:\Doit\web\umijs-antd-pro\node_modules\.pnpm\umi@4.0.71_elcmqxbumjoc3let763237kd3y\node_modules\umi\dist\service\service.js
- D:\Doit\web\umijs-antd-pro\node_modules\.pnpm\umi@4.0.71_elcmqxbumjoc3let763237kd3y\node_modules\umi\dist\cli\forkedDev.js
- D:\Doit\web\umijs-antd-pro\node_modules\.pnpm\umi@4.0.71_elcmqxbumjoc3let763237kd3y\node_modules\umi\bin\forkedDev.js
at D:\Doit\web\umijs-antd-pro\node_modules\.pnpm\@umijs+preset-umi@4.0.71_lyjbtud22co2ahpp6zb6tamdfe\node_modules\@umijs\preset-umi\dist\features\mock\getMockData.js:64:13
at Array.reduce (<anonymous>)
at getMockData (D:\Doit\web\umijs-antd-pro\node_modules\.pnpm\@umijs+preset-umi@4.0.71_lyjbtud22co2ahpp6zb6tamdfe\node_modules\@umijs\preset-umi\dist\features\mock\getMockData.js:57:10)
at updateMockData (D:\Doit\web\umijs-antd-pro\node_modules\.pnpm\@umijs+preset-umi@4.0.71_lyjbtud22co2ahpp6zb6tamdfe\node_modules\@umijs\preset-umi\dist\features\mock\mock.js:63:61)
at FSWatcher.onChange (D:\Doit\web\umijs-antd-pro\node_modules\.pnpm\@umijs+preset-umi@4.0.71_lyjbtud22co2ahpp6zb6tamdfe\node_modules\@umijs\preset-umi\dist\features\mock\mock.js:81:9)
at FSWatcher.emit (events.js:400:28)
at FSWatcher.emitWithAll (D:\Doit\web\umijs-antd-pro\node_modules\.pnpm\chokidar@3.5.3\node_modules\chokidar\index.js:541:32)
at FSWatcher._emit (D:\Doit\web\umijs-antd-pro\node_modules\.pnpm\chokidar@3.5.3\node_modules\chokidar\index.js:632:8)
at listener (D:\Doit\web\umijs-antd-pro\node_modules\.pnpm\chokidar@3.5.3\node_modules\chokidar\lib\nodefs-handler.js:370:20)
无法识别d.ts文件的namespace
error - Error: Mock file D:\Doit\web\umijs-antd-pro\mock\Information.ts parse failed.
RequestUrl is not defined
at D:\Doit\web\umijs-antd-pro\node_modules\.pnpm\@umijs+preset-umi@4.0.71_lyjbtud22co2ahpp6zb6tamdfe\node_modules\@umijs\preset-umi\dist\features\mock\getMockData.js:64:13
at Array.reduce (<anonymous>)
at getMockData (D:\Doit\web\umijs-antd-pro\node_modules\.pnpm\@umijs+preset-umi@4.0.71_lyjbtud22co2ahpp6zb6tamdfe\node_modules\@umijs\preset-umi\dist\features\mock\getMockData.js:57:10)
at updateMockData (D:\Doit\web\umijs-antd-pro\node_modules\.pnpm\@umijs+preset-umi@4.0.71_lyjbtud22co2ahpp6zb6tamdfe\node_modules\@umijs\preset-umi\dist\features\mock\mock.js:63:61)
at Hook.fn (D:\Doit\web\umijs-antd-pro\node_modules\.pnpm\@umijs+preset-umi@4.0.71_lyjbtud22co2ahpp6zb6tamdfe\node_modules\@umijs\preset-umi\dist\features\mock\mock.js:88:5)
at D:\Doit\web\umijs-antd-pro\node_modules\.pnpm\@umijs+core@4.0.71\node_modules\@umijs\core\dist\service\service.js:112:40
at _next1 (eval at create (D:\Doit\web\umijs-antd-pro\node_modules\.pnpm\@umijs+bundler-utils@4.0.71\node_modules\@umijs\bundler-utils\compiled\tapable\index.js:1:8410), <anonymous>:34:17)
at eval (eval at create (D:\Doit\web\umijs-antd-pro\node_modules\.pnpm\@umijs+bundler-utils@4.0.71\node_modules\@umijs\bundler-utils\compiled\tapable\index.js:1:8410), <anonymous>:59:1)
Context
Umi Version: @umijs/max^4.0.71
Node Version: v14.18.1
Platform: websorm@23-01
The text was updated successfully, but these errors were encountered:
@umijs/max^4.0.71下,mock文件夹无法识别'@'路径,无法识别d.ts文件的namespace
我看到:feat: support use @ in mock files 这个帖子,上面实现了mock.js文件对@符号的识别,但是对于umijs@4来说似乎不起作用?
Mini Showcase Repository(REQUIRED)
这是我的代码仓库:https://github.com/qian357891/umijs-demo
How To Reproduce
Steps to reproduce the behavior: 1. 2.
文件目录:
|--mock
|--Information.ts
...
|--src
|--constants
|--requestUrl.ts
...
step 1
requestUrl.ts
step 2
Information.ts
Expected behavior 1. 2.
我希望能够在mock文件夹中的文件中使用@来代替'../src'路径,或者在mock文件夹下的文件中使用其他文件的declare进行全局常量的声明。我以为是以为mock目录与src同级,但我在src父级文件夹下创建文件夹以及文件,可以正常实现上面两个操作。
无法识别@路径
无法识别d.ts文件的namespace
Context
The text was updated successfully, but these errors were encountered: