Open futuremillionaire14 opened 1 year ago
Hi @futuremillionaire14.
Looking at your project I found a couple issues:
package.json
and code are in a subfolder named frontend
. Because of that, StackBlitz is not finding a package.json
at the root of the project and will not try to install npm dependencies or run a start command (which would be npm start
for this project).package.json
file is actually named package.json
, with a trailing space. So it's technically not named package.json
, and not recognized by tools.These Terminal commands seem to work in your project:
cd frontend
mv 'package.json ' 'package.json'
npm install
npm start
After that, webpack seems to start in development mode correctly, but there are still some errors in your code:
ReactDOM.render
from 'react-dom/client'
but that render
method doesn't exist. I think you might have code intended for React 16 or 17, but might be trying to use it with React 18, and the exports have changed in React 18.Thank you very much for your thorough response Florens. I am still somewhat of a novice at coding so any feedback helps. Have a great day!
All the best
On Mon, Jan 9, 2023 at 1:58 PM Florens Verschelde @.***> wrote:
Hi @futuremillionaire14 https://github.com/futuremillionaire14.
Looking at your project I found a couple issues:
- Your package.json and code are in a subfolder named frontend. Because of that, StackBlitz is not finding a package.json at the root of the project and will not try to install npm dependencies or run a start command (which would be npm start for this project).
- On top of that, your package.json file is actually named package.json , with a trailing space. So it's technically not named package.json, and not recognized by tools.
These Terminal commands seem to work in your project:
cd frontend mv 'package.json ' 'package.json' npm install npm start
After that, webpack seems to start in development mode correctly, but there are still some errors in your code:
- One file is importing a module that doesn't exist.
- You're trying to use ReactDOM.render from 'react-dom/client' but that render method doesn't exist. I think you might have code intended for React 16 or 17, but might be trying to use it with React 18, and the exports have changed in React 18.
— Reply to this email directly, view it on GitHub https://github.com/stackblitz/webcontainer-core/issues/936#issuecomment-1376132580, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4UMI3SAZH2HRJWB2EDMWHTWRRNVLANCNFSM6AAAAAATVWDBKI . You are receiving this because you were mentioned.Message ID: @.***>
Actually a couple of more things for you. Bare with me, I am a novice at this. Do you think my code is salvageable? Or should I scrap it and start again. I am incorporating the things you mentioned but I am still having issues. I don't want really want to start over.
Thank you for your patience.
Describe the bug
Having issues with getting my development server to function. Surely it is an easy fix. I simply tried
npm start
to set up my development server but I keep getting a json file not found error but I have a Json package. I am sure I am over thinking it but a brand new set of eyes would help. At this point the project should at show up in the development server and display the bare bones with no errors. I am pretty sure when I started the project it had a development server...any help would be great. Too far into the project to ditch it. Thanks again!Link to the blitz that caused the error
https://stackblitz.com/edit/node-jd7clw?file=frontend%2Fsrc%2FControllers%2FbugController.js,frontend%2Fsrc%2FApp.js
Steps to reproduce
none
Expected behavior
dev server with Login: username box and password
Parity with Local
Screenshots
none
Platform
Additional context
none