Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to follow the documentation to run smoothly. #2

Closed
dohooo opened this issue Jan 15, 2022 · 10 comments
Closed

Unable to follow the documentation to run smoothly. #2

dohooo opened this issue Jan 15, 2022 · 10 comments
Labels
bug Something isn't working

Comments

@dohooo
Copy link

dohooo commented Jan 15, 2022

First of all, thank you for making this tool, can let me debug vite more easily and learn it. Thank you!

Maybe it's not a bug, but I want to give some feedback, because there may be people out there who have the same problem as me.

Describe the bug

When I run 'make app-pnpm run build', I will be prompted with many type check errors by default, most of which are caused by the configuration problem of '/app/tsconfig.json' in the '/app' directory, which causes the incompatible vite module type check and causes the execution failure.

I recommend either removing tsc from build scripts or changing the default configuration in tsconfig.json so that it can at least run dev/build/serve.

To reproduce

Steps to reproduce the behaviour:

  1. Clone down or download the vitejs-docker-dev repository:

Clone: git clone https://github.com/nystudio107/vitejs-docker-dev.git

Download: vitejs-docker-dev

  1. Go into the vitejs-docker-dev directory:
cd vitejs-docker-dev
  1. Build the Docker image:
make docker

This will be somewhat lengthy, as it builds the Docker image, and then clones down the vitejs repository, and installs all of its dependencies

  1. Start Vite in development mode (located in the vite/ dir):
make vite-pnpm run dev
  1. In a new terminal, start the Vite app that you use for developing/testing (located in the app/ dir):
# build (important)
make app-pnpm run build

Expected behaviour

works fine

Screenshots

some types error from /vitejs-docker-dev/vite/packages/vite/src

Versions

  • Plugin version:
  • vitejs-docker-dev@1.0.3
@dohooo dohooo added the bug Something isn't working label Jan 15, 2022
@khalwat
Copy link
Contributor

khalwat commented Jan 15, 2022

hmmm that's pretty strange, the app/ is just the default that is created using vue-cli to create a new TypeScript project.

It definitely was compiling properly when I created vitejs-docker-dev but I will attempt to reproduce.

@dohooo
Copy link
Author

dohooo commented Jan 15, 2022

Tomorrow I will try to reproduce this problem on another computer, perhaps because of my environment. I'll get back to you

@dohooo
Copy link
Author

dohooo commented Jan 15, 2022

hmmm that's pretty strange, the app/ is just the default that is created using vue-cli to create a new TypeScript project.

It definitely was compiling properly when I created vitejs-docker-dev but I will attempt to reproduce.

Thank you for your reply

@khalwat
Copy link
Contributor

khalwat commented Jan 15, 2022

Nope, shouldn't matter -- the point of using it in a Dockerized setup is that your local environment doesn't matter.

I'll try to reproduce it, and let you know.

@khalwat
Copy link
Contributor

khalwat commented Jan 15, 2022

I attempted to reproduce your issue, but I'm unable to.

I did the following:

  1. Starting from a clean slate:
make clean
  1. Building the Docker image:
make docker
  1. Fire up Vite in development mode:
make vite-pnpm run dev

...and wait for the above to finish, until we see:

rollup v2.62.0
bundles /app/vite/packages/vite/src/client/env.ts → dist/client/env.mjs...
created dist/client/env.mjs in 7.2s
bundles /app/vite/packages/vite/src/client/client.ts → dist/client/client.mjs...
created dist/client/client.mjs in 6.5s
bundles /app/vite/packages/vite/src/node/index.ts, /app/vite/packages/vite/src/node/cli.ts → dist...
created dist in 29.2s

[2022-01-15 18:07:27] waiting for changes...
  1. Wait for the above to finish, then fire up the app in a new terminal window:
make app-pnpm run dev

...and wait until we see:


  vite v2.8.0-beta.2 dev server running at:

  > Local:    http://localhost:3000/
  > Network:  http://172.17.0.3:3000/

  ready in 3459ms.


Then I'm able to load the test app in the browser without issues:

Screen Shot 2022-01-15 at 1 43 21 PM

Nowhere in this process do I see any build errors. Can you show me what build errors you're seeing, and what you're doing to get them?

@khalwat
Copy link
Contributor

khalwat commented Jan 15, 2022

ahhhh my bad @dohooo -- you are saying it's the build that doesn't work for the app. Apologies for missing that detail, let me have a look.

@khalwat
Copy link
Contributor

khalwat commented Jan 15, 2022

Okay so the reason it fails is it runs tsc which checks the entire codebase using the tsconfig.json for the app, which is then applied to the entire Vite codebase, because it's all running in development mode.

I think the right thing to do here is just to remove the tsc and if people want to add that back in, it'll be up to them to resolve the type checking for their app to ensure it works with the rest of the Vite code base.

There probably isn't much of a use-case for building the app (the purpose of Vite.js Docker Dev is to help you develop Vite in a containerized way, not as a way for you to develop your own app.

But I agree it should work out of the box.

khalwat pushed a commit that referenced this issue Jan 15, 2022
…t can build successfully out of the box ([#2](#2))
@khalwat
Copy link
Contributor

khalwat commented Jan 15, 2022

@khalwat khalwat closed this as completed Jan 15, 2022
@dohooo
Copy link
Author

dohooo commented Jan 16, 2022

ahhhh, I thought I'd finally get a chance to submit PR to the library, but it looks like I didn't.

But thank you for checking anyway, okay

@khalwat
Copy link
Contributor

khalwat commented Jan 16, 2022

I'm sorry, you're right, I should have worked with you to get this PR integrated instead of doing it myself.

Apologies. Please don't let it discourage you from submitting future PRs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants