bridge icon indicating copy to clipboard operation
bridge copied to clipboard

ENOTDIR in Nuxt bridge with pinia v0.4.0+

Open danielroe opened this issue 3 years ago • 4 comments

Trying to upgrade to v0.4.0 with Nuxt bridge and trying to build the application gives me:

 ERROR  Rollup error: ENOTDIR: not a directory, stat '/.../node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/pinia/dist/pinia.mjs/dist/pinia'


 FATAL  ENOTDIR: not a directory, stat '/.../node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/pinia/dist/pinia.mjs/dist/pinia'

Here you go: https://codesandbox.io/s/nuxt-pinia-evblty Run a yarn build to reproduce the error.

Originally posted by @dargmuesli in https://github.com/vuejs/pinia/discussions/1582.

danielroe avatar Aug 23 '22 12:08 danielroe

Upgrading @uppy/core and @uppy/tus to v3 gave me the typical missing transpilation issues in dev. Adding

      '@uppy/companion-client',
      '@uppy/core',
      '@uppy/store-default',
      '@uppy/tus',
      '@uppy/utils',
      'nanoid',

to the transpile error makes dev accessible again, but yields the following error on build:

 ERROR  Rollup error: ENOTDIR: not a directory, stat '/.../node_modules/.pnpm/node_modules/tus-js-client/lib.es5/browser/index.js/lib.es5/browser'

 FATAL  ENOTDIR: not a directory, stat '/.../node_modules/.pnpm/node_modules/tus-js-client/lib.es5/browser/index.js/lib.es5/browser'

I do have the alias 'tus-js-client': 'tus-js-client/lib.es5/browser/index.js' still set up, and it seems I cannot remove it yet. That rollup import path sounds much like the pinia issue. I'm wondering why those errors only appear under those upgrade circumstances though? :D

dargmuesli avatar Aug 24 '22 22:08 dargmuesli

Same error here with yarn generate:

Nuxt Fatal Error
Error: ENOTDIR: not a directory, stat
node_modules/pinia/dist/pinia.mjs/dist/pinia

retroriff avatar Aug 25 '22 15:08 retroriff

In this case you can work around it by adding pinia to your build.transpile array:

import { defineNuxtConfig } from '@nuxt/bridge'

export default defineNuxtConfig({
  modules: ['@pinia/nuxt'],
  build: {
    transpile: ['pinia'],
  },
})

danielroe avatar Aug 31 '22 21:08 danielroe

@danielroe That worked, thank you 👍

retroriff avatar Sep 03 '22 13:09 retroriff