framework icon indicating copy to clipboard operation
framework copied to clipboard

Expected "meta" but found "meta$1" - rollup error with dynamic imports

Open lucassimines opened this issue 3 years ago • 4 comments

Environment


  • Operating System: Darwin
  • Node Version: v16.14.2
  • Nuxt Version: 3.0.0-rc.8-27681070.ad63817
  • Package Manager: [email protected]
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://codesandbox.io/s/delicate-hill-p8707x?file=/views/subpages/%5Bid%5D.vue

Describe the bug

If I call more than one Lazy component between different folders, the Nuxt build will throw an error.

Additional context

To reproduce, run $ npm run build

Logs

Expected "meta" but found "meta$1"
11717|  };
11718|
11719|  defineAsyncComponent(() => __vitePreload(() => import('./Text.100e7f97.js'),true?"__VITE_PRELOAD__":void 0,import.meta$1.url));
   |                        ^
11720|  const meta$1 = undefined;
11721|

lucassimines avatar Aug 19 '22 13:08 lucassimines

@danielroe the build error I mentioned yesterday

lucassimines avatar Aug 19 '22 13:08 lucassimines

@danielroe Please take a read https://github.com/nuxt/framework/pull/6789#issuecomment-1237506822

simirka avatar Sep 05 '22 22:09 simirka

This is still reproducible (although less frequently) - thanks @simirka for reproduction: https://codesandbox.io/s/suspicious-cherry-pqq6ci?file=/pages/test.vue.

Initially I think it's a rollup or vite bug.

danielroe avatar Sep 06 '22 09:09 danielroe

@danielroe You welcome) I haven't found a quick fix, but yep it seems like rollup, something related to syntax. But the thing that it's working on rc.8.

simirka avatar Sep 06 '22 10:09 simirka