prismicio / slice-machine

A series of tools for developing and deploying website sections with Prismic
https://prismic.io/docs
Apache License 2.0
287 stars 53 forks source link

NODE_ENV env variable causes unexpected port proxy #1027

Closed pinktonio closed 1 year ago

pinktonio commented 1 year ago

Is your feature request related to a problem? Please describe.

During the migration from slice-machine-ui version 0.7.1 to the new breaking 1.x version for my next.js project I faced an issue where the slice machine dashboard wouldn't show up on port 9999 after running start-slicemachine. It only created a proxy from port 3000 where my next.js app was running so i only saw that. This left me confused and searching for the issue on my end for hours.

Describe the solution you'd like

I found out that this was caused by the export NODE_ENV=development environment variable set in my ~/.zshrcfile which caused the redirect set in prismicio/slice-machine/packages/start-slicemachine/src/lib/createSliceMachineExpressApp.ts LN 84. Removing the environment variables solved it. I feel like the environment variable name should be changed for something slicemachine specific as this can easily cause issues for others who have this variable set globally.

mdeclercq commented 1 year ago

Hi @pinktonio,

Thanks for reporting and providing the workaround to not use the NODE_ENV=development environment variable. It can help others!

For info we encountered this issue recently and opened an internal ticket to address it. We'll update this issue once it has been fixed.

xrutayisire commented 1 year ago

Fixed in last 1.12.0, thanks for the issue. Don't hesitate to reopen if needed.