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
/Users/xunwu/docod/test/uni-vue3-ts-template/node_modules/.pnpm/[email protected]/node_modules/vk-uview-ui/index.js:2
import mixin from './libs/mixin/mixin.js'
^^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (internal/modules/cjs/loader.js:1001:16)
at Module._compile (internal/modules/cjs/loader.js:1049:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at ModuleWrap. (internal/modules/esm/translators.js:199:29)
at ModuleJob.run (internal/modules/esm/module_job.js:183:25)
at async Loader.import (internal/modules/esm/loader.js:178:24)
at async nodeImport (file:///Users/xunwu/docod/test/uni-vue3-ts-template/node_modules/.pnpm/[email protected]_ppdxls77r7tfsxvxidunrbldv4/node_modules/vite/dist/node/chunks/dep-51c4f80a.js:53132:21)
at async eval (/src/main.ts:9:31)
at async instantiateModule (file:///Users/xunwu/docod/test/uni-vue3-ts-template/node_modules/.pnpm/[email protected]_ppdxls77r7tfsxvxidunrbldv4/node_modules/vite/dist/node/chunks/dep-51c4f80a.js:53053:9)
二、如果package.js加入"type":"module",则报如下错误:
failed to load config from /Users/xunwu/docod/test/uni-vue3-ts-template/vite.config.ts
error when starting dev server:
TypeError: uni is not a function
at file:///Users/xunwu/docod/test/uni-vue3-ts-template/vite.config.ts.timestamp-1680072557068.mjs:9:5
at ModuleJob.run (internal/modules/esm/module_job.js:183:25)
at async Loader.import (internal/modules/esm/loader.js:178:24)
at async loadConfigFromBundledFile (file:///Users/xunwu/docod/test/uni-vue3-ts-template/node_modules/.pnpm/[email protected]_ppdxls77r7tfsxvxidunrbldv4/node_modules/vite/dist/node/chunks/dep-51c4f80a.js:62827:21)
at async loadConfigFromFile (file:///Users/xunwu/docod/test/uni-vue3-ts-template/node_modules/.pnpm/[email protected]_ppdxls77r7tfsxvxidunrbldv4/node_modules/vite/dist/node/chunks/dep-51c4f80a.js:62712:28)
at async resolveConfig (file:///Users/xunwu/docod/test/uni-vue3-ts-template/node_modules/.pnpm/[email protected]_ppdxls77r7tfsxvxidunrbldv4/node_modules/vite/dist/node/chunks/dep-51c4f80a.js:62336:28)
at async Module.createServer (file:///Users/xunwu/docod/test/uni-vue3-ts-template/node_modules/.pnpm/[email protected]_ppdxls77r7tfsxvxidunrbldv4/node_modules/vite/dist/node/chunks/dep-51c4f80a.js:61636:20)
at async createSSRServer (/Users/xunwu/docod/test/uni-vue3-ts-template/node_modules/.pnpm/@dcloudio[email protected][email protected][email protected]/node_modules/@dcloudio/vite-plugin-uni/dist/cli/server.js:42:18)
at async CAC.runDev (/Users/xunwu/docod/test/uni-vue3-ts-template/node_modules/.pnpm/@dcloudio[email protected][email protected][email protected]/node_modules/@dcloudio/vite-plugin-uni/dist/cli/action.js:22:28)
ELIFECYCLE Command failed with exit code 1.
三、本地环境
node: v14.19.3
pnpm: 7.26.3
The text was updated successfully, but these errors were encountered:
一、错误信息如下:
/Users/xunwu/docod/test/uni-vue3-ts-template/node_modules/.pnpm/[email protected]/node_modules/vk-uview-ui/index.js:2
import mixin from './libs/mixin/mixin.js'
^^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (internal/modules/cjs/loader.js:1001:16)
at Module._compile (internal/modules/cjs/loader.js:1049:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at ModuleWrap. (internal/modules/esm/translators.js:199:29)
at ModuleJob.run (internal/modules/esm/module_job.js:183:25)
at async Loader.import (internal/modules/esm/loader.js:178:24)
at async nodeImport (file:///Users/xunwu/docod/test/uni-vue3-ts-template/node_modules/.pnpm/[email protected]_ppdxls77r7tfsxvxidunrbldv4/node_modules/vite/dist/node/chunks/dep-51c4f80a.js:53132:21)
at async eval (/src/main.ts:9:31)
at async instantiateModule (file:///Users/xunwu/docod/test/uni-vue3-ts-template/node_modules/.pnpm/[email protected]_ppdxls77r7tfsxvxidunrbldv4/node_modules/vite/dist/node/chunks/dep-51c4f80a.js:53053:9)
error when starting dev server:
TypeError: uni is not a function
at file:///Users/xunwu/docod/test/uni-vue3-ts-template/vite.config.ts.timestamp-1680072557068.mjs:9:5
at ModuleJob.run (internal/modules/esm/module_job.js:183:25)
at async Loader.import (internal/modules/esm/loader.js:178:24)
at async loadConfigFromBundledFile (file:///Users/xunwu/docod/test/uni-vue3-ts-template/node_modules/.pnpm/[email protected]_ppdxls77r7tfsxvxidunrbldv4/node_modules/vite/dist/node/chunks/dep-51c4f80a.js:62827:21)
at async loadConfigFromFile (file:///Users/xunwu/docod/test/uni-vue3-ts-template/node_modules/.pnpm/[email protected]_ppdxls77r7tfsxvxidunrbldv4/node_modules/vite/dist/node/chunks/dep-51c4f80a.js:62712:28)
at async resolveConfig (file:///Users/xunwu/docod/test/uni-vue3-ts-template/node_modules/.pnpm/[email protected]_ppdxls77r7tfsxvxidunrbldv4/node_modules/vite/dist/node/chunks/dep-51c4f80a.js:62336:28)
at async Module.createServer (file:///Users/xunwu/docod/test/uni-vue3-ts-template/node_modules/.pnpm/[email protected]_ppdxls77r7tfsxvxidunrbldv4/node_modules/vite/dist/node/chunks/dep-51c4f80a.js:61636:20)
at async createSSRServer (/Users/xunwu/docod/test/uni-vue3-ts-template/node_modules/.pnpm/@dcloudio[email protected][email protected][email protected]/node_modules/@dcloudio/vite-plugin-uni/dist/cli/server.js:42:18)
at async CAC.runDev (/Users/xunwu/docod/test/uni-vue3-ts-template/node_modules/.pnpm/@dcloudio[email protected][email protected][email protected]/node_modules/@dcloudio/vite-plugin-uni/dist/cli/action.js:22:28)
ELIFECYCLE Command failed with exit code 1.
三、本地环境
node: v14.19.3
pnpm: 7.26.3
The text was updated successfully, but these errors were encountered: