Should not import the named export 'version' (imported as 'Q') from default-exporting module (only default export is available soon)
I get this message by building (with webpack) an app importing perspective 4.7.1 and adding the webpack plugin.
Additional Context:
Issue seems to be in migrate.ts, line:
import { version as PKG_VERSION } from "@finos/perspective/package.json" assert { type: "json" };
Replacing it with::
import packageInfo from "@finos/perspective/package.json" assert { type: "json" };
and then PKG_VERSION with
packageInfo.version
seems to fix it.
Note that i tested this fix by hacking my way and changing the compiled perspective-viewer.js file installed at node_modules, so i did not test changing the migrate.ts source but i think it is very likely to be analogous.
Bug Report
I have bumped into an error similar to what's described here:
https://github.com/finos/perspective/discussions/2507
Should not import the named export 'version' (imported as 'Q') from default-exporting module (only default export is available soon)
I get this message by building (with webpack) an app importing perspective 4.7.1 and adding the webpack plugin.
Additional Context:
Issue seems to be in
migrate.ts
, line:import { version as PKG_VERSION } from "@finos/perspective/package.json" assert { type: "json" };
Replacing it with::
import packageInfo from "@finos/perspective/package.json" assert { type: "json" };
and then
PKG_VERSION
withpackageInfo.version
seems to fix it.
Note that i tested this fix by hacking my way and changing the compiled
perspective-viewer.js
file installed at node_modules, so i did not test changing themigrate.ts
source but i think it is very likely to be analogous.Note this is a common issue with imports as it can be seen here: https://stackoverflow.com/questions/64993118/error-should-not-import-the-named-export-version-imported-as-version