Uncaught ReferenceError: process is not defined

process is in a .js file. That js file is a script imported to a html file. But it seems like process isn’t defined.

Where do you reference process – is it in the html file (such as an onclick attr?) If so, a lot of the boilerplates in Glitch have a defer attribute added onto script tags which would mean that the browser would attempt to reference the label in memory before it’s been defined in the JS file.

i have an obj at the start of a file and that file is added as script. The script will run a function onLoad when the site loads and an onclick function. So how to do it? add a defer attribute (defer=“defer”)?

I think the easiest thing to do would be to apply the onclick in the js file – just like, a classic document.getElementById('my-button-id').addEventListener('click', myFunction) kind of thing. If you have the script executing onLoad then it should have access to the button by the time it runs! Does that make sense/apply to your use case?

No, i don’t think you get what i mean. At the top of the script file i define an object with an username and password. the password is in the env. The file does run a onLoad function when it loads and a login function when someone signs in. Or it doesn’t make sens

Well i just learned about passing variables in the express respone, so i guess i’ll do that.

1 Like

Cool! Thanks for the update!