07akioni / vueuc

Util Components for Vue
https://vueuc.vercel.app
MIT License
273 stars 32 forks source link

Error when trying to load finweck-tree.js in Nuxt 3 #187

Open superstoffer opened 2 years ago

superstoffer commented 2 years ago

Error when trying to load finweck-tree.js in Nuxt 3

/Users/christoffer/coding/nuxt3-app/node_modules/vueuc/es/shared/finweck-tree.js:4
export class FinweckTree {
^^^^^^

SyntaxError: Unexpected token 'export'
    at Object.compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1027:15)
    at Module._compile (node:internal/modules/cjs/loader:1063:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:170:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:198:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:409:24)
[nitro] [request error] [vite dev] Error loading external "/Users/christoffer/coding/nuxt3-app/node_modules/vueuc/es/shared/finweck-tree.js".
  at ./.nuxt/dist/server/server.mjs:10131:293
  at async __instantiateModule__ (./.nuxt/dist/server/server.mjs:121698:3)
[nitro] [request error] [vite dev] Error loading external "/Users/christoffer/coding/nuxt3-app/node_modules/vueuc/es/shared/finweck-tree.js".
  at ./.nuxt/dist/server/server.mjs:10131:293
  at async __instantiateModule__ (./.nuxt/dist/server/server.mjs:121698:3)
07akioni commented 2 years ago

Maybe you should add it to transform.

07akioni commented 2 years ago

The package is not now a pure esm module. So nuxt won't work with it by default.