Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perspective refuses to work with React with webpack 4.x #1512

Closed
garneck opened this issue Aug 11, 2021 · 2 comments
Closed

Perspective refuses to work with React with webpack 4.x #1512

garneck opened this issue Aug 11, 2021 · 2 comments

Comments

@garneck
Copy link

garneck commented Aug 11, 2021

I'm trying to get Perspective to work in my codesandbox example, with webpack 4.39.1.

My environment: https://codesandbox.io/s/nervous-shirley-frey2

Followed instructions in docs, included the recommended plugin. However, when I attempt to start the app, I receive following errors:

ERROR in ./node_modules/@finos/perspective-viewer/src/js/utils.js 305:22
Module parse failed: Unexpected token (305:22)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See 
https://webpack.js.org/concepts#loaders
|     // does nothing.
|     descriptor.value.flush = async function(obj) {
>         if (obj[lock]?.lock) {
|             await obj[lock].lock;
|             await new Promise(requestAnimationFrame);
 @ ./node_modules/@finos/perspective-viewer-datagrid/dist/esm/perspective-viewer-datagrid.js 2:0-75 1236:0-14
 @ ./app/components/Root/Root.js
 @ ./app/index.js

And:

ERROR in ./node_modules/@finos/perspective-viewer/dist/esm/@finos/perspective-vieux/pkg/perspective_vieux.js 597:22
Module parse failed: Unexpected token (597:22)
File was processed with these loaders:
 * ./node_modules/string-replace-loader/index.js
You may need an additional loader to handle the result of these loaders.
| async function init(input) {
|     if (typeof input === 'undefined') {
>         input = import.meta.url.replace(/\.js$/, '_bg.wasm');
|     }
|     const imports = {};
 @ ./node_modules/@finos/perspective-viewer/dist/esm/viewer.js 2:0-102 3:0-126 52:13-39 53:2-1654:9-26
 @ ./app/components/Root/Root.js
 @ ./app/index.js

Please advise on how to resolve this, does not seem to work as per documentation.

@krzysztofpniak
Copy link

I'm facing the same issue, and it blocks my team.

@texodus
Copy link
Member

texodus commented Oct 12, 2021

@finos/perspective-webpack-plugin does not support Webpack 4, as per the docs. You'll either need to not use the plugin, or upgrade to Webpack 5.

@texodus texodus closed this as completed Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants