Scaffolded "empty" custom component error on local machine: Uncaught ReferenceError: process is not defined

Michael Culhan1
Kilo Sage

I'm trying to get set up to build a custom component for UI Builder, however when running the scaffolded component I get the error message below in the browser console.  If I added buttons or checkmarks into the view (in index.js), they render in the browser but are not clickable.  This same behavior happens on two different machines, so I must be doing something wrong.

Uncaught ReferenceError: process is not defined
    at Object.4043 (<anonymous>:2:13168)
    at r (<anonymous>:2:306599)
    at Object.8048 (<anonymous>:2:9496)
    at r (<anonymous>:2:306599)
    at Object.8641 (<anonymous>:2:1379)
    at r (<anonymous>:2:306599)
    at <anonymous>:2:315627
    at <anonymous>:2:324225
    at <anonymous>:2:324229
    at HTMLIFrameElement.e.onload (index.js:1:371098)
4043 @ VM70:2
r @ VM70:2
8048 @ VM70:2
r @ VM70:2
8641 @ VM70:2
r @ VM70:2
(anonymous) @ VM70:2
(anonymous) @ VM70:2
(anonymous) @ VM70:2
e.onload @ index.js:1
be @ index.js:1
he @ index.js:1
onmessage @ entry-devserver.js:38
../node_modules/error-overlay-webpack-plugin/node_modules/sockjs-client/lib/event/eventtarget.js.EventTarget.dispatchEvent @ eventtarget.js:51
(anonymous) @ main.js:282
../node_modules/error-overlay-webpack-plugin/node_modules/sockjs-client/lib/main.js.SockJS._transportMessage @ main.js:280
../node_modules/error-overlay-webpack-plugin/node_modules/sockjs-client/lib/event/emitter.js.EventEmitter.emit @ emitter.js:50
WebSocketTransport.ws.onmessage @ websocket.js:35
load (async)
be @ index.js:1
he @ index.js:1
onmessage @ entry-devserver.js:38
../node_modules/error-overlay-webpack-plugin/node_modules/sockjs-client/lib/event/eventtarget.js.EventTarget.dispatchEvent @ eventtarget.js:51
(anonymous) @ main.js:282
../node_modules/error-overlay-webpack-plugin/node_modules/sockjs-client/lib/main.js.SockJS._transportMessage @ main.js:280
../node_modules/error-overlay-webpack-plugin/node_modules/sockjs-client/lib/event/emitter.js.EventEmitter.emit @ emitter.js:50
WebSocketTransport.ws.onmessage @ websocket.js:35

find_real_file.png

  Here are the steps I took:

  1. Install NodeJS 12.16.1
  2. NPM 6.13.4 seems to install with NodeJS
  3. Install the Now CLI from the store (the links to the Innovation lab on this page no longer work for me).
  4. Install the UI-Component extension (snc extension add --name ui-component)
  5. Set up a default profile to my instance (snc configure profile set)
  6. Create a new folder on my local machine
  7. Scaffold a new component (snc ui-component project --name @myorg/hello-world --scope x_myorg_helloworld --offline)
  8. Run npm install in the folder to install all the dependencies.  I do get a bunch of warnings about deprecated modules
  9. Start the dev server by running snc ui-component develop. 
  10. Even without adding anything to the scaffolded component I get the error.  If I add a simple html button it is not clickable. 

Here are the last lines of the result of npm install:

added 3197 packages from 2201 contributors and audited 3200 packages in 398.173s

90 packages are looking for funding
  run `npm fund` for details

found 780 vulnerabilities (45 low, 383 moderate, 310 high, 42 critical)
  run `npm audit fix` to fix them, or `npm audit` for details
1 ACCEPTED SOLUTION

Michael Culhan1
Kilo Sage

This post solved my problem

https://community.servicenow.com/community?id=community_question&sys_id=e0fa505edb8dcd50e515c2230596194e

View solution in original post

1 REPLY 1

Michael Culhan1
Kilo Sage

This post solved my problem

https://community.servicenow.com/community?id=community_question&sys_id=e0fa505edb8dcd50e515c2230596194e