[Resolved] - Uncaught ReferenceError: process is not defined

I have 2 projects that were at 35

I brought one up to 38 & that process went fairly well

The second one is not having any success using process.env.VARIABLES in the ./web side

I did have to add the webpack config and import the stream-browserify & crypto-browserify modules

The first one uses them there just fine, without the webpack config

In both projects I have used the includeEnvironmentVariables in the redwood.toml and listed the vars I try to access in the ./web side

very confusing


It was actually the package jsonwebtoken that was trying to use process.version

Apparently a lot of people are having trouble with the replacement jwt-decode not having a webpack 5 export

I replaced it with a routine I found online and removed jsonwebtoken entirely

All is well again

const wt_decode = (token) => {
  var base64Url = token.split('.')[1];
  var base64 = base64Url.replace('-', '+').replace('_', '/');
  return JSON.parse(window.atob(base64));