netless-io / fastboard

An open sourced whiteboard starter based on white-web-sdk.
MIT License
56 stars 35 forks source link

Netless giving error on fresh npm i #33

Open AnshuBansal6 opened 4 months ago

AnshuBansal6 commented 4 months ago

Any one please help to fix this error?

image

Uncaught ReferenceError: process is not defined at 4043 (:2:13168) at r (:2:306599) at 8048 (:2:9496) at r (:2:306599) at 8641 (:2:1379) at r (:2:306599) at :2:315627 at :2:324225 at :2:324229 at e.onload (common_app.chunk.js:158268:370943) common_app.chunk.js:158268 ./node_modules/@netless/synced-store/node_modules/value-enhancer/dist/index.js 27:29 Module parse failed: Unexpected token (27:29) 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 | }; | var INIT_VALUE = {};

var isVal = (val2) => !!val2?.$valCompute; var markVal = identity;

console. @ common_app.chunk.js:158268 common_app.chunk.js:158268 ./node_modules/remitter/dist/main.js 90:12 Module parse failed: Unexpected token (90:12) 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 | An event name to listen to all events or to remit on any event listener. | / ANY_EVENT = ANY_EVENT; | #listeners = / @PURE / new Map(); | #relayListeners;

hyrious commented 4 months ago
  1. "process is not defined" is maybe come from some dependencies having code checking process.env.NODE_ENV. This is a common practice in many libraries, for example Vue. Many bundlers support this convention in order to support tree shaking React's style of exporting dev/prod modules depending on the environment.

    You can probably find your define feature of the bundler and define process.env.NODE_ENV as "production" to solve this issue.

  2. "Module parse failed: Unexpected token" is because your bundler did not recognize the 2 new syntaxes of JavaScript:

    You need to upgrade your tooling. I believe webpack has supported ES2022.