微信小程序开启 分包 , web 端报错[Question]
- Dominant language
- JavaScript
- Stars
- 8k
- Forks
- 611
- PR merge metrics
- No merged PRs in 30d
Description
微信小程序开启 分包 , web 端报错 , 小程序端可以使用
src/app.js
`
import { runApp } from 'rax-app';
runApp();
`
src/app.json
`
{
"routes": [
{
"source": "pages/Main/app",
"miniappMain": true
},
{
"source": "pages/Park/app"
}
]
}
`
报错信息
`
error in ./src/app.json
Module build failed (from ./node_modules/build-plugin-rax-app/lib/Loaders/RouteLoader.js):
Error: There need path field in this route: [object Object]
at getComponentName (F:\wCode\lc-park-rax\lc-park\node_modules\build-plugin-rax-app\lib\Loaders\RouteLoader.js:104:15)
at F:\wCode\lc-park-rax\lc-park\node_modules\build-plugin-rax-app\lib\Loaders\RouteLoader.js:83:179
at Array.forEach ()
at Object.addDynamicImportRouteExpression (F:\wCode\lc-park-rax\lc-park\node_modules\build-plugin-rax-app\lib\Loaders\RouteLoader.js:82:20)
at Object.default_1 (F:\wCode\lc-park-rax\lc-park\node_modules\build-plugin-rax-app\lib\Loaders\RouteLoader.js:46:260)
✖ Web
`
Contributor guide
Research direction
Start with the reproduction in src/app.json and inspect build-plugin-rax-app/lib/Loaders/RouteLoader.js around getComponentName at line 104. Run the web build with the two-route configuration, compare its route expectations with the miniapp configuration, and consider the issue done when the web build completes without this error while the miniapp routes remain valid.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- build-system, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100