GeoffSelby / cra-template-tailwindcss

A streamlined Tailwind CSS template for Create React App
38 stars 4 forks source link

ReferenceError: process is not defined #11

Closed matt-d-webb closed 2 years ago

matt-d-webb commented 2 years ago

I am utilising the @geoffcodesthings/react-scripts package to run my CRA tailwind project and have recently started seeing the following error running locally:

image

Trying to troubleshoot this, I am finding a lot of solutions suggesting "upgrading to react-scrapts v5.0.0" as a solution, for example:

Note: I am not aware of a specific dependency update recently that has lead to this issue surfacing itself.

Is this an issue you're aware of, or how this maybe resolved within the context of this fork that supports the tailwind postcss plugin.

I am using the following dependency versions:

ref: https://github.com/chess-centre/platform/blob/master/chess-centre-app/package.json

I have tried to blast my node_modules and reinstall the dependency tree, this seemed to fix it (I was seeing this manifesting less frequently), but that seems to be short lived as I am now seeing this frequently.

matt-d-webb commented 2 years ago

Just to update this, as updating to react-scripts v5 is not easily done if using Tailwind unless you plan to update all your css processing scripts (via craco or directly using postcss npm scripts).

A workaround that seems to be working is to add the following to your dev dependency: "react-error-overlay": "6.0.9"

Ref: https://github.com/facebook/create-react-app/issues/11771

GeoffSelby commented 2 years ago

I will take a look at this after lunch. I’ll need to look into react-scripts v5 to see what’s new as well.

matt-d-webb commented 2 years ago

I think I was premature in my workaround, I am still seeing this issue. Don't suppose you have managed to dig into what is causing this?

GeoffSelby commented 2 years ago

I've been super busy and honestly forgot about this template for a while. My react-scripts fork is no longer needed as CRA now supports PostCss 8 and custom a postcss.config.js. I just tagged v4 of this template which updates to Tailwind v3 and no longer relies on a custom react-scripts.