Vite.js import warning

1968
2
Jump to solution
11-08-2021 08:30 AM
john_cartwright_noaa
New Contributor III

Hello All,

I'm using vite.js (2.6.4) w/ the v4.21.2 of JSAPI and getting the warning listed below when I start up the dev server.  I heard Rene mention something about this in one of his videos and understood it to be a problem fixed in 4.19.  However I can't find mention of it in the changelog.  I'm also confused because it looks like a Webpack problem when I thought vite.js used Rollup.  Can anyone please clarify for me?

Thanks!

--john

/Users/jcc/projects/webmap-demo/node_modules/.vite/chunk-3UH5BQI4.js
1823|      return module2[exportName];
1824|    }
1825|    return import(
   |                  ^
1826|      /* webpackInclude: /\.entry\.js$/ */
1827|      /* webpackExclude: /\.system\.entry\.js$/ */
The above dynamic import cannot be analyzed by vite.
See https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations for supported dynamic import formats. If this is intended to be left as-is, you can use the /* @vite-ignore */ comment inside the import() call to suppress this warning.

  Plugin: vite:import-analysis
  File: /Users/jcc/projects/webmap-demo/node_modules/.vite/chunk-3UH5BQI4.js?v=0d4ab57f

 

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
ReneRubalcava
Frequent Contributor II

This isn't specific to the ArcGIS JSAPI. I think it might be part of how Stencil does it's builds and adds the ignore comments for webpack builds, but doesn't for vite. Understandable, it doesn't have the userbase that webpack does. This warning can be safely ignored, there is no fix we can provide. If you really want to suppress the warnings, this issue has some recommendations.

View solution in original post

0 Kudos
2 Replies
ReneRubalcava
Frequent Contributor II

This isn't specific to the ArcGIS JSAPI. I think it might be part of how Stencil does it's builds and adds the ignore comments for webpack builds, but doesn't for vite. Understandable, it doesn't have the userbase that webpack does. This warning can be safely ignored, there is no fix we can provide. If you really want to suppress the warnings, this issue has some recommendations.

0 Kudos
john_cartwright_noaa
New Contributor III

Thanks for the explanation Rene.  I couldn't seem to suppress just that specific warning, so I just set Vite's "--logLevel error" in the npm script.

0 Kudos