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

Unknown path aliases in docker container #3950

Closed
nguyenthinhkha opened this issue Apr 6, 2025 · 2 comments
Closed

Unknown path aliases in docker container #3950

nguyenthinhkha opened this issue Apr 6, 2025 · 2 comments
Labels
information needed Further information is requested question This issue is about a user needing insight start Everything about TanStack Start

Comments

@nguyenthinhkha
Copy link

Which project does this relate to?

Start

Describe the bug

Unknown path aliases in docker container
Refer to path aliases set up: https://tanstack.com/start/latest/docs/framework/react/path-aliases

Your Example Website or App

https://codesandbox.io/p/devbox/github/tanstack/router/tree/main/examples/react/start-basic-auth

Steps to Reproduce the Bug or Issue

  1. Use basic auth example
  2. Add docker file, like this
FROM node:22-alpine

WORKDIR /app

COPY package*.json ./
COPY prisma ./prisma/

RUN npm install
RUN npm run db:gen

COPY . .

EXPOSE 3000

CMD [ "npm", "run", "dev" ]
  1. add docker compose for db & app
services:
  db:
    image: postgres:latest
    container_name: db
    ports:
      - "5001:5432"
    env_file:
      - .env.docker
    volumes:
      - db_data:/var/lib/postgresql/data
    environment:
      - PGDATA=/var/lib/postgresql/data

  app:
    build:
      dockerfile: Dockerfile
      context: .
    container_name: app
    ports:
      - 3000:3000
    env_file:
      - .env.docker
    volumes:
      - ./:/app
    depends_on:
      - db
    command: sh -c "npx prisma migrate deploy && npx prisma generate --sql &&  npm run dev"

volumes:
  db_data:
    driver: local

  1. run docker compose up to start 2 services
  2. Go to http://{your-ip}:3000/login

You will see the errors on terminal like this

Error in renderToPipeableStream: Error: Cannot find module '@/components/login' imported from '/app/src/routes/(auth)/login.tsx'

while it's working fine if you run npm run dev without docker

Expected behavior

We can launch app in docker container

Screenshots or Videos

No response

Platform

  • OS: Linux
  • Browser: Chrome
  • Version: latest

Additional context

Tanstack start use Vinxi, so I think the problem can be related to that lib - https://vinxi.vercel.app/guide/aliases.html

@SeanCassiere
Copy link
Member

Attach a valid reproduction.

If you are unable to generate a valid reproduction, join our Discord server and post your question in #start-questions, where we could potentially arrange call with a maintainer to walk through what's going on on your machine. Additionally, search in that channel for other Docker related questions, they may help.


Also, see these issues listed below and see if any of the user responses fix your issue.

@SeanCassiere SeanCassiere added information needed Further information is requested question This issue is about a user needing insight start Everything about TanStack Start labels Apr 6, 2025
@nguyenthinhkha nguyenthinhkha closed this as not planned Won't fix, can't repro, duplicate, stale Apr 8, 2025
@nguyenthinhkha
Copy link
Author

Forget this, it's my mistake to rename case-insensitive file then hasn't checked git commit. Sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
information needed Further information is requested question This issue is about a user needing insight start Everything about TanStack Start
Projects
None yet
Development

No branches or pull requests

2 participants