alibaba / alibaba/rax

微信小程序开启 分包 , web 端报错[Question]

Open
#2,376 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.