getsentry / spotlight

Your Universal Debug Toolbar
https://spotlightjs.com
Other
377 stars 11 forks source link

@spotlightjs/spotlight Version 2.0 and above #483

Closed 897049470 closed 2 months ago

897049470 commented 3 months ago

error in ./node_modules/@spotlightjs/overlay/dist/index-5682ce90.js

Module parse failed: Unexpected token (1949:15) 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 | } = n, c; | c = a.map((v, M) => p(v, typeof v == "string" ? null : v.state, M === 0 ? "default" : void 0));

let E = d(s ?? c.length - 1), u = Vi.Pop, R = null; | function d(v) { | return Math.min(Math.max(v, 0), c.length - 1);

@ ./node_modules/@spotlightjs/overlay/dist/sentry-spotlight.js 1:0-136 2:0-16:2 2:0-16:2 2:0-16:2 2:0-16:2 2:0-16:2 2:0-16:2 2:0-16:2 2:0-16:2 2:0-16:2 2:0-16:2 2:0-16:2 2:0-16:2 2:0-16:2 @ ./node_modules/@spotlightjs/spotlight/dist/overlay.js @ ./src/install.js @ ./src/app.js @ ./src/main.js @ multi (webpack)-dev-server/client?http://172.16.15.65:3001&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js

897049470 commented 3 months ago

According to the following configuration

import * as Spotlight from '@spotlightjs/spotlight';

// only load Spotlight in dev if (process.env.NODE_ENV === "development") { Spotlight.init(); }

BYK commented 3 months ago

Hi, it looks like your webpack configuration is not suitable for the ESM and JS versions that we use. Looks like it's stumbling on the ?? operator which is really not that new. Maybe this can help you: https://stackoverflow.com/a/72519431/90297

BYK commented 2 months ago

Closing due to lack of response. Feel free to reopen if you are still having issues and decide to come back here :)