[SOLVED] Webpack issue with PlayCanvas Engine 1.70.2

I recently updated the playcanvas node module from 1.62.2 to 1.70.2.
When I start the game it displays the following error

WARNING in ./node_modules/playcanvas/build/playcanvas/src/framework/handlers/script.js 99:2-64
Critical dependency: the request of a dependency is an expression

Based on searching for this issue it seems that webpack doesn’t like the dynamic import on line 99 of
node_modules/playcanvas/build/playcanvas/src/framework/handlers/script.js

import(/* @vite-ignore */importUrl.toString()).then(module => {

I’ve tried adding ignoreParse to the module in my webpack config file but it doesn’t seem to help.

calling @Mark_Lundin

Probably this

Try using noParse Module | webpack or the exclude rule option. These should allow you to ignore this warning.

We should probably add a /* webpackIgnore: true */ here since we already do this for Vite

Fix for this Add webpack ignore by marklundin · Pull Request #6359 · playcanvas/engine · GitHub

3 Likes

Thanks Mark_Lundin. Is this now available in the PlayCanvas node module?

Not currently, but we’re working on a 1.70.3 release which should be out today / tomorrow, and will have this change.

Great!

and done

2 Likes