teslamotors / informed

A lightweight framework and utility for building powerful forms in React applications
https://teslamotors.github.io/informed
MIT License
956 stars 173 forks source link

upon using npm run dev command its throwing an error #470

Closed samr874 closed 8 months ago

samr874 commented 8 months ago

I want to run the application by using npm run dev I am getting this error how to resolve this issue by using which commands ![image](https://github.com/teslamotors/informed/assets/60845180/a7376bcc-a091-44ad-a4d2-fca530eb9fd7)

joepuzzo commented 8 months ago

try npm run start

samr874 commented 8 months ago

try npm run start

but its saying that D:/informed/dist/esm this file is missing image what to do is it the same case from your end??

joepuzzo commented 8 months ago

ahhh can you run npm run build first

samr874 commented 8 months ago

This app is not running and the content is not getting displayed

joepuzzo commented 8 months ago

I think I need to update README

npm run build

npm run start 

Build will build the source code

Start will start a dev server for the docs

joepuzzo commented 8 months ago

Note, you need to re build if you make code changes to src for them to take affect in the local docs

samr874 commented 8 months ago

@joepuzzo Thank you will try to update it will follow the solutions as follows

samr874 commented 8 months ago

@joepuzzo actually the error http://localhost:5173/informed/dist/esm this url is throwing response as 404 not found

joepuzzo commented 8 months ago
  1. Are you running at least node version 18
  2. Did you make sure to npm install everything
  3. You ran npm run build
  4. You ran npm start ?

I just did all the following and see no issues

samr874 commented 8 months ago

just try to inspect the application @joepuzzo this http://localhost:5173/informed/dist/esm URL is throwing the problem

joepuzzo commented 8 months ago

That tells me you did not have a successful build after npm run build

joepuzzo commented 8 months ago
Screenshot 2024-03-11 at 12 17 40 PM
joepuzzo commented 8 months ago

This is what a successful build looks like

samr874 commented 8 months ago

so I have to pull from master branch as per your terminal

samr874 commented 8 months ago

what is your solution to this

samr874 commented 8 months ago
  1. Are you running at least node version 18
  2. Did you make sure to npm install everything
  3. You ran npm run build
  4. You ran npm start ?

I just did all the following and see no issues

yes I did everything but still the same issue

joepuzzo commented 8 months ago

There is no problem to fix.. there is simply following the layed out.

  1. Are you running at least node version 18
  2. Did you make sure to npm install everything
  3. You ran npm run build
  4. You ran npm start ?

your error indicates that you never successfully build the code with npm run build. You need to get that to happen.

joepuzzo commented 8 months ago

let me ask you this... do you have a dist directory that was created after you ran npm run build ?

And in that directory do you have an esm directory ?

samr874 commented 8 months ago

no there is no dist directory

joepuzzo commented 8 months ago

Then the build never succeeded. Are you on a mac or windows machine?

samr874 commented 8 months ago

I am on windows what to do now

joepuzzo commented 8 months ago

run a terminal that has bash. you can google how to do this. The problem is all development done on this project is done on mac or linux and the build command relys on a few unix commands so thats prob why its failing.

Just google "how to run bash terminal on windows"

samr874 commented 8 months ago

are you sure will it work but what difference does it make of os

joepuzzo commented 8 months ago

Ha literally its just this https://github.com/teslamotors/informed/blob/master/package.json#L23

The fact that it runs a rm -rf dist && rollup that is unix command / syntax to run stuff.

joepuzzo commented 8 months ago

so yes if you run in a terminal that supports unix/linux commands it should work fine

joepuzzo commented 8 months ago

Why are you trying to run this locally in the first place may I ask ? Are you looking to contribute? Learn? Test?

samr874 commented 8 months ago

@joepuzzo thank you so much now it's working

so the contributors working on windows os. use this as script "build": "rimraf dist && rollup --config && npm run fix:cjs"