Esri / calcite-design-system

A monorepo containing the packages for Esri's Calcite Design System
https://developers.arcgis.com/calcite-design-system/
Other
289 stars 76 forks source link

New build errors in Gatsby and SvelteKit sample apps #9909

Closed benelan closed 3 months ago

benelan commented 3 months ago

Check existing issues

Actual Behavior

Some new build errors in SSR apps were introduced due to #9650.

Expected Behavior

No new build errors in SSR apps

Reproduction Sample

https://github.com/noahmulfinger/gatsby-calcite-components

Reproduction Steps

  1. Clone the repro sample above from #9242
  2. Run: npm install @esri/calcite-components@v2.11.0-next.0
  3. Run: npm run build
  4. Notice the errors
  5. Run: npm install @esri/calcite-components@v2.10.2-next.2
  6. Repeat step 3
  7. Notice there are different errors, which I resolved in #9897

Reproduction Version

@esri/calcite-components@v2.11.0-next.0

Relevant Info

The build errors you'll see from the repro steps:

failed Building production JavaScript and CSS bundles - 10.978s

 ERROR #98124  WEBPACK.BUILD-JAVASCRIPT

Generating JavaScript bundles failed

undefined

If you're trying to use a package make sure that 'undefined' is installed. If you're trying to use a local file make sure that the path is correct.

File: node_modules/@esri/calcite-components/dist/components/ExpandToggle.js:6:0

The error above is repeated all (I think?) of the files in dist/components.


The SvelteKit repro sample also has build errors:

✘ [ERROR] Missing "./internal/client/index.js" specifier in "@stencil/core" package [plugin vite:dep-pre-bundle]

    node_modules/@esri/calcite-components/dist/components/index.js:8:73:
      8 │ export { getAssetPath, setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client/index.js';
        ╵                                                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  This error came from the "onResolve" callback registered here:

    node_modules/esbuild/lib/main.js:1150:20:
      1150 │       let promise = setup({
           ╵                     ^

    at setup (file:///****/calcite-design-system-ssr-repro-9242/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:47463:13)
    at handlePlugins (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:1150:21)
    at buildOrContextImpl (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:873:5)
    at Object.buildOrContext (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:699:5)
    at /****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:2032:68
    at new Promise (<anonymous>)
    at Object.context (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:2032:27)
    at Object.context (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:1874:58)
    at prepareEsbuildOptimizerRun (file:///****/calcite-design-system-ssr-repro-9242/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:51405:33)

✘ [ERROR] Missing "./internal/client/index.js" specifier in "@stencil/core" package [plugin vite:dep-pre-bundle]

    node_modules/@esri/calcite-components/dist/components/button.js:6:71:
      6 │ import { proxyCustomElement, HTMLElement, forceUpdate, Build, h } from '@stencil/core/internal/client/index.js';
        ╵                                                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  This error came from the "onResolve" callback registered here:

    node_modules/esbuild/lib/main.js:1150:20:
      1150 │       let promise = setup({
           ╵                     ^

    at setup (file:///****/calcite-design-system-ssr-repro-9242/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:47463:13)
    at handlePlugins (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:1150:21)
    at buildOrContextImpl (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:873:5)
    at Object.buildOrContext (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:699:5)
    at /****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:2032:68
    at new Promise (<anonymous>)
    at Object.context (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:2032:27)
    at Object.context (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:1874:58)
    at prepareEsbuildOptimizerRun (file:///****/calcite-design-system-ssr-repro-9242/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:51405:33)

✘ [ERROR] Missing "./internal/client/index.js" specifier in "@stencil/core" package [plugin vite:dep-pre-bundle]

    node_modules/@esri/calcite-components/dist/components/loadable.js:6:35:
      6 │ import { Build, forceUpdate } from '@stencil/core/internal/client/index.js';
        ╵                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  This error came from the "onResolve" callback registered here:

    node_modules/esbuild/lib/main.js:1150:20:
      1150 │       let promise = setup({
           ╵                     ^

    at setup (file:///****/calcite-design-system-ssr-repro-9242/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:47463:13)
    at handlePlugins (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:1150:21)
    at buildOrContextImpl (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:873:5)
    at Object.buildOrContext (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:699:5)
    at /****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:2032:68
    at new Promise (<anonymous>)
    at Object.context (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:2032:27)
    at Object.context (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:1874:58)
    at prepareEsbuildOptimizerRun (file:///****/calcite-design-system-ssr-repro-9242/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:51405:33)

✘ [ERROR] Missing "./internal/client/index.js" specifier in "@stencil/core" package [plugin vite:dep-pre-bundle]

    node_modules/@esri/calcite-components/dist/components/loader.js:6:57:
      6 │ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client/index.js';
        ╵                                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  This error came from the "onResolve" callback registered here:

    node_modules/esbuild/lib/main.js:1150:20:
      1150 │       let promise = setup({
           ╵                     ^

    at setup (file:///****/calcite-design-system-ssr-repro-9242/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:47463:13)
    at handlePlugins (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:1150:21)
    at buildOrContextImpl (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:873:5)
    at Object.buildOrContext (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:699:5)
    at /****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:2032:68
    at new Promise (<anonymous>)
    at Object.context (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:2032:27)
    at Object.context (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:1874:58)
    at prepareEsbuildOptimizerRun (file:///****/calcite-design-system-ssr-repro-9242/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:51405:33)

✘ [ERROR] Missing "./internal/client/index.js" specifier in "@stencil/core" package [plugin vite:dep-pre-bundle]

    node_modules/@esri/calcite-components/dist/components/icon.js:6:78:
      6 │ import { getAssetPath, proxyCustomElement, HTMLElement, h, Host, Build } from '@stencil/core/internal/client/index.js';
        ╵                                                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  This error came from the "onResolve" callback registered here:

    node_modules/esbuild/lib/main.js:1150:20:
      1150 │       let promise = setup({
           ╵                     ^

    at setup (file:///****/calcite-design-system-ssr-repro-9242/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:47463:13)
    at handlePlugins (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:1150:21)
    at buildOrContextImpl (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:873:5)
    at Object.buildOrContext (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:699:5)
    at /****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:2032:68
    at new Promise (<anonymous>)
    at Object.context (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:2032:27)
    at Object.context (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:1874:58)
    at prepareEsbuildOptimizerRun (file:///****/calcite-design-system-ssr-repro-9242/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:51405:33)

✘ [ERROR] Missing "./internal/client/index.js" specifier in "@stencil/core" package [plugin vite:dep-pre-bundle]

    node_modules/@esri/calcite-components/dist/components/observers.js:6:22:
      6 │ import { Build } from '@stencil/core/internal/client/index.js';
        ╵                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  This error came from the "onResolve" callback registered here:

    node_modules/esbuild/lib/main.js:1150:20:
      1150 │       let promise = setup({
           ╵                     ^

    at setup (file:///****/calcite-design-system-ssr-repro-9242/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:47463:13)
    at handlePlugins (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:1150:21)
    at buildOrContextImpl (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:873:5)
    at Object.buildOrContext (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:699:5)
    at /****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:2032:68
    at new Promise (<anonymous>)
    at Object.context (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:2032:27)
    at Object.context (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:1874:58)
    at prepareEsbuildOptimizerRun (file:///****/calcite-design-system-ssr-repro-9242/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:51405:33)

✘ [ERROR] Missing "./internal/client/index.js" specifier in "@stencil/core" package [plugin vite:dep-pre-bundle]

    node_modules/@esri/calcite-components/dist/components/interactive.js:6:25:
      6 │ import { Build, h } from '@stencil/core/internal/client/index.js';
        ╵                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  This error came from the "onResolve" callback registered here:

    node_modules/esbuild/lib/main.js:1150:20:
      1150 │       let promise = setup({
           ╵                     ^

    at setup (file:///****/calcite-design-system-ssr-repro-9242/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:47463:13)
    at handlePlugins (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:1150:21)
    at buildOrContextImpl (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:873:5)
    at Object.buildOrContext (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:699:5)
    at /****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:2032:68
    at new Promise (<anonymous>)
    at Object.context (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:2032:27)
    at Object.context (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:1874:58)
    at prepareEsbuildOptimizerRun (file:///****/calcite-design-system-ssr-repro-9242/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:51405:33)

✘ [ERROR] Missing "./internal/client/index.js" specifier in "@stencil/core" package [plugin vite:dep-pre-bundle]

    node_modules/@esri/calcite-components/dist/components/form.js:6:18:
      6 │ import { h } from '@stencil/core/internal/client/index.js';
        ╵                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  This error came from the "onResolve" callback registered here:

    node_modules/esbuild/lib/main.js:1150:20:
      1150 │       let promise = setup({
           ╵                     ^

    at setup (file:///****/calcite-design-system-ssr-repro-9242/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:47463:13)
    at handlePlugins (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:1150:21)
    at buildOrContextImpl (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:873:5)
    at Object.buildOrContext (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:699:5)
    at /****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:2032:68
    at new Promise (<anonymous>)
    at Object.context (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:2032:27)
    at Object.context (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:1874:58)
    at prepareEsbuildOptimizerRun (file:///****/calcite-design-system-ssr-repro-9242/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:51405:33)

✘ [ERROR] Missing "./internal/client/index.js" specifier in "@stencil/core" package [plugin vite:dep-pre-bundle]

    node_modules/@esri/calcite-components/dist/components/t9n.js:6:36:
      6 │ import { Build, getAssetPath } from '@stencil/core/internal/client/index.js';
        ╵                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  This error came from the "onResolve" callback registered here:

    node_modules/esbuild/lib/main.js:1150:20:
      1150 │       let promise = setup({
           ╵                     ^

    at setup (file:///****/calcite-design-system-ssr-repro-9242/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:47463:13)
    at handlePlugins (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:1150:21)
    at buildOrContextImpl (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:873:5)
    at Object.buildOrContext (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:699:5)
    at /****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:2032:68
    at new Promise (<anonymous>)
    at Object.context (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:2032:27)
    at Object.context (/****/calcite-design-system-ssr-repro-9242/node_modules/esbuild/lib/main.js:1874:58)
    at prepareEsbuildOptimizerRun (file:///****/calcite-design-system-ssr-repro-9242/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:51405:33)

Regression?

@esri/calcite-components@v2.10.2-next.2

Priority impact

impact - p1 - need for current milestone

Impact

No response

Calcite package

Esri team

Calcite (dev)

github-actions[bot] commented 3 months ago

Installed and assigned for verification.

jcfranco commented 3 months ago

Verified locally. 🚀