Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vite:dep-scan throws error for vue3-otp-input package #7051

Closed
7 tasks done
YusufcanY opened this issue Feb 23, 2022 · 3 comments
Closed
7 tasks done

vite:dep-scan throws error for vue3-otp-input package #7051

YusufcanY opened this issue Feb 23, 2022 · 3 comments

Comments

@YusufcanY
Copy link

Describe the bug

I've been trying to use vue3-otp-input with vite but I'm getting an error.

[plugin vite:dep-scan] Failed to resolve entry for package "vue3-otp-input". The package may have incorrect main/module/exports specified in its package.json: Failed to resolve entry for package "vue3-otp-input". The package may have incorrect main/module/exports specified in its package.json.

Reproduction

https://stackblitz.com/edit/vitejs-vite-wegesn?file=src/App.vue

System Info

System Info
System:
    OS: Ubuntu 20.04
    Container: Yes
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 17.0 - /usr/bin/node
    Yarn: 1.22.17 - /usr/bin/yarn
    npm: 8.1.0 - /usr/bin/npm
  Browsers:
    Brave Browser: unknown
  npmPackages:
    "vue": "^3.2.25",
    "vue3-otp-input": "^0.2.2"
    "@vitejs/plugin-vue": "^2.2.0",
    "vite": "^2.8.0"

Used Package Manager

yarn

Logs

$ vite build --debug
  vite:config bundled config file loaded in 272.60ms +0ms
  vite:config using resolved config: {
  vite:config   plugins: [
  vite:config     'alias',
  vite:config     'vite:modulepreload-polyfill',
  vite:config     'vite:resolve',
  vite:config     'vite:html-inline-proxy',
  vite:config     'vite:css',
  vite:config     'vite:esbuild',
  vite:config     'vite:json',
  vite:config     'vite:wasm',
  vite:config     'vite:worker',
  vite:config     'vite:worker-import-meta-url',
  vite:config     'vite:asset',
  vite:config     'vite:vue',
  vite:config     'vite:define',
  vite:config     'vite:css-post',
  vite:config     'vite:watch-package-data',
  vite:config     'vite:build-html',
  vite:config     'commonjs',
  vite:config     'vite:data-uri',
  vite:config     'rollup-plugin-dynamic-import-variables',
  vite:config     'vite:asset-import-meta-url',
  vite:config     'vite:build-import-analysis',
  vite:config     'vite:esbuild-transpile',
  vite:config     'vite:terser',
  vite:config     'vite:reporter',
  vite:config     'vite:load-fallback'
  vite:config   ],
  vite:config   build: {
  vite:config     target: [ 'es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1' ],
  vite:config     polyfillModulePreload: true,
  vite:config     outDir: 'dist',
  vite:config     assetsDir: 'assets',
  vite:config     assetsInlineLimit: 4096,
  vite:config     cssCodeSplit: true,
  vite:config     cssTarget: [ 'es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1' ],
  vite:config     sourcemap: false,
  vite:config     rollupOptions: {},
  vite:config     minify: 'esbuild',
  vite:config     terserOptions: {},
  vite:config     write: true,
  vite:config     emptyOutDir: null,
  vite:config     manifest: false,
  vite:config     lib: false,
  vite:config     ssr: false,
  vite:config     ssrManifest: false,
  vite:config     reportCompressedSize: true,
  vite:config     chunkSizeWarningLimit: 500,
  vite:config     watch: null,
  vite:config     commonjsOptions: { include: [Array], extensions: [Array] },
  vite:config     dynamicImportVarsOptions: { warnOnError: true, exclude: [Array] }
  vite:config   },
  vite:config   define: { __VUE_OPTIONS_API__: true, __VUE_PROD_DEVTOOLS__: false },
  vite:config   ssr: { external: [ 'vue', '@vue/server-renderer' ] },
  vite:config   configFile: '/home/projects/vitejs-vite-wegesn/vite.config.js',
  vite:config   configFileDependencies: [ 'vite.config.js' ],
  vite:config   inlineConfig: {
  vite:config     root: undefined,
  vite:config     base: undefined,
  vite:config     mode: undefined,
  vite:config     configFile: undefined,
  vite:config     logLevel: undefined,
  vite:config     clearScreen: undefined,
  vite:config     build: {}
  vite:config   },
  vite:config   root: '/home/projects/vitejs-vite-wegesn',
  vite:config   base: '/',
  vite:config   resolve: { dedupe: undefined, alias: [ [Object], [Object] ] },
  vite:config   publicDir: '/home/projects/vitejs-vite-wegesn/public',
  vite:config   cacheDir: '/home/projects/vitejs-vite-wegesn/node_modules/.vite',
  vite:config   command: 'build',
  vite:config   mode: 'production',
  vite:config   isProduction: true,
  vite:config   server: {
  vite:config     preTransformRequests: true,
  vite:config     fs: { strict: true, allow: [Array], deny: [Array] }
  vite:config   },
  vite:config   preview: {
  vite:config     port: undefined,
  vite:config     strictPort: undefined,
  vite:config     host: undefined,
  vite:config     https: undefined,
  vite:config     open: undefined,
  vite:config     proxy: undefined,
  vite:config     cors: undefined,
  vite:config     headers: undefined
  vite:config   },
  vite:config   env: { BASE_URL: '/', MODE: 'production', DEV: false, PROD: true },
  vite:config   assetsInclude: [Function: assetsInclude],
  vite:config   logger: {
  vite:config     hasWarned: false,
  vite:config     info: [Function: info],
  vite:config     warn: [Function: warn],
  vite:config     warnOnce: [Function: warnOnce],
  vite:config     error: [Function: error],
  vite:config     clearScreen: [Function: clearScreen],
  vite:config     hasErrorLogged: [Function: hasErrorLogged]
  vite:config   },
  vite:config   packageCache: Map(0) { set: [Function (anonymous)] },
  vite:config   createResolver: [Function: createResolver],
  vite:config   optimizeDeps: {
  vite:config     esbuildOptions: { keepNames: undefined, preserveSymlinks: undefined }
  vite:config   },
  vite:config   worker: {
  vite:config     format: 'iife',
  vite:config     plugins: [
  vite:config       [Object], [Object], [Object],
  vite:config       [Object], [Object], [Object],
  vite:config       [Object], [Object], [Object],
  vite:config       [Object], [Object], [Object],
  vite:config       [Object], [Object], [Object],
  vite:config       [Object], [Object], [Object],
  vite:config       [Object], [Object], [Object],
  vite:config       [Object], [Object], [Object]
  vite:config     ],
  vite:config     rollupOptions: {}
  vite:config   }
  vite:config } +8ms
vite v2.8.4 building for production...
✓ 5 modules transformed.
[vite:resolve] Failed to resolve entry for package "vue3-otp-input". The package may have incorrect main/module/exports specified in its package.json: Failed to resolve entry for package "vue3-otp-input". The package may have incorrect main/module/exports specified in its package.json.
error during build:
Error: Failed to resolve entry for package "vue3-otp-input". The package may have incorrect main/module/exports specified in its package.json: Failed to resolve entry for package "vue3-otp-input". The package may have incorrect main/module/exports specified in its package.json.
    at packageEntryFailure (/home/projects/vitejs-vite-wegesn/node_modules/vite/dist/node/chunks/dep-971d9e33.js:29521:11)
    at resolvePackageEntry (/home/projects/vitejs-vite-wegesn/node_modules/vite/dist/node/chunks/dep-971d9e33.js:29517:9)
    at tryNodeResolve (/home/projects/vitejs-vite-wegesn/node_modules/vite/dist/node/chunks/dep-971d9e33.js:29333:20)
    at Object.resolveId (/home/projects/vitejs-vite-wegesn/node_modules/vite/dist/node/chunks/dep-971d9e33.js:29150:28)
    at eval (/home/projects/vitejs-vite-wegesn/node_modules/rollup/dist/shared/rollup.js:22795:37)
[!] Error: unfinished hook action(s) on exit:
(vite:asset) load "/home/projects/vitejs-vite-wegesn/src/assets/logo.png"

Validations

@YusufcanY
Copy link
Author

@dai-shi

@Niputi
Copy link
Contributor

Niputi commented Feb 23, 2022

you will need to open the issue at their repo.
libraries exporting esm need to end on .mjs or have the type be equal to module

@Niputi Niputi closed this as completed Feb 23, 2022
@YusufcanY
Copy link
Author

Can you explain more? I will fix it and i don't have any experience on plugin or component package development.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants