Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Update index.ts #32

Merged
merged 1 commit into from
Aug 4, 2021
Merged

Update index.ts #32

merged 1 commit into from
Aug 4, 2021

Conversation

falstack
Copy link
Contributor

@falstack falstack commented Aug 4, 2021

fixed:if importStr is undefinedresolveNodeModules will break eg:

[vite:style-import] The "path" argument must be of type string. Received undefined
file: filepath
error during build:
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at validateString (internal/validators.js:124:11)
    at Object.join (path.js:1148:7)
    at resolveNodeModules (/Users/yuistack/Documents/bilibili/laputa/node_modules/vite-plugin-style-import/dist/index.js:21:58)
    at /Users/yuistack/Documents/bilibili/laputa/node_modules/vite-plugin-style-import/dist/index.js:158:21
    at Array.filter (<anonymous>)
    at removeAlreadyName (/Users/yuistack/Documents/bilibili/laputa/node_modules/vite-plugin-style-import/dist/index.js:155:20)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async Object.transform (/Users/yuistack/Documents/bilibili/laputa/node_modules/vite-plugin-style-import/dist/index.js:120:44)
    at async ModuleLoader.addModuleSource (/Users/yuistack/Documents/bilibili/laputa/node_modules/rollup/dist/shared/rollup.js:19706:30)
    at async ModuleLoader.fetchModule (/Users/yuistack/Documents/bilibili/laputa/node_modules/rollup/dist/shared/rollup.js:19762:9)

fixed:if `importStr` is `undefined`,`resolveNodeModules` will break eg:
``` shell
[vite:style-import] The "path" argument must be of type string. Received undefined
file: filepath
error during build:
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at validateString (internal/validators.js:124:11)
    at Object.join (path.js:1148:7)
    at resolveNodeModules (/Users/yuistack/Documents/bilibili/laputa/node_modules/vite-plugin-style-import/dist/index.js:21:58)
    at /Users/yuistack/Documents/bilibili/laputa/node_modules/vite-plugin-style-import/dist/index.js:158:21
    at Array.filter (<anonymous>)
    at removeAlreadyName (/Users/yuistack/Documents/bilibili/laputa/node_modules/vite-plugin-style-import/dist/index.js:155:20)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async Object.transform (/Users/yuistack/Documents/bilibili/laputa/node_modules/vite-plugin-style-import/dist/index.js:120:44)
    at async ModuleLoader.addModuleSource (/Users/yuistack/Documents/bilibili/laputa/node_modules/rollup/dist/shared/rollup.js:19706:30)
    at async ModuleLoader.fetchModule (/Users/yuistack/Documents/bilibili/laputa/node_modules/rollup/dist/shared/rollup.js:19762:9)
```
@anncwb anncwb merged commit 84d93d8 into vbenjs:main Aug 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants