Skip to content

Commit a602b2c

Browse files
author
Guillaume Chau
committed
fix(ui): client addon serve error
1 parent 0c1c245 commit a602b2c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/@vue/cli-ui/src/graphql-api/connectors/client-addons.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ function serve (req, res) {
4949
const { id, 0: file } = req.params
5050
const addon = findOne(id)
5151
if (addon) {
52-
const basePath = getBasePath(require.resolve(addon.path))
53-
res.sendFile(path.join(basePath, file))
52+
const basePath = getBasePath(require.resolve(addon.path || ''))
53+
basePath && res.sendFile(path.join(basePath, file))
5454
} else {
5555
res.status(404)
5656
res.send(`Addon ${id} not found in loaded addons. Try opening a vue-cli project first?`)

0 commit comments

Comments
 (0)