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

Within a dev container using Docker 26, vite dev or vite preview cannot be accessed from the host #16522

Open
7 tasks done
sharky98 opened this issue Apr 24, 2024 · 7 comments

Comments

@sharky98
Copy link

sharky98 commented Apr 24, 2024

Describe the bug

I initialy though this was a case of #11468 (comment), but it seems it is something else, so I am opening another issue.

Using Dev Containers for development, and after upgrading to Docker 26 (from 25) on the host, I am unable to connect to either vite dev or vite preview server using the default and basic port forwarding feature of the dev containers.

By "unable to connect", I mean that the server is launched, however when trying to connect from my host using http://localhost:4200/, either Chromium or Firefox Dev Edition request hangs indefinitely on loading (it stays in loading state without timing out for at least for a good 5-10 minutes; didn't test longer than that).

I am using Nx, but using vite directly does not change the outcome.
For the recoard, I also have a dotnet server that is responding as expected to the request, so for now (in my limited available code base), this point out to vite, but it may well be due to whichever node server backend vite is using.

Reproduction

unable to provide without control of the host docker version

Steps to reproduce

No response

System Info

Dev Container

I am using a custom pre-built image, which is a copy of mcr.microsoft.com/devcontainers/typescript-node:20

  System:
    OS: Linux 6.5 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
    CPU: (16) x64 Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz
    Memory: 26.03 GB / 31.12 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 20.12.2 - /usr/local/share/nvm/versions/node/v20.12.2/bin/node
    Yarn: 1.22.19 - /usr/bin/yarn
    npm: 10.5.0 - /usr/local/share/nvm/versions/node/v20.12.2/bin/npm
    pnpm: 9.0.1 - /usr/local/share/nvm/versions/node/v20.12.2/bin/pnpm
  npmPackages:
    @vitejs/plugin-react: 4.2.1 => 4.2.1 
    @vitejs/plugin-react-swc: 3.6.0 => 3.6.0 
    vite: 5.2.8 => 5.2.8

Host

  • docker-ce-cli (5:26.1.0-1~ubuntu.22.04~jammy)
  • docker-ce (5:26.1.0-1~ubuntu.22.04~jammy)
  System:
    OS: Linux 6.5 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
    CPU: (16) x64 Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz
    Memory: 24.96 GB / 31.12 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 20.11.1 - ~/.nvm/versions/node/v20.11.1/bin/node
    npm: 10.5.0 - ~/.nvm/versions/node/v20.11.1/bin/npm
    pnpm: 8.15.5 - ~/.nvm/versions/node/v20.11.1/bin/pnpm
  Browsers:
    Chromium: 124.0.6367.60

Used Package Manager

pnpm

Logs

Click to expand!
vite:config bundled config file loaded in 107.76ms +0ms
vite:config using resolved config: {
vite:config   root: '/workspaces/[project]/apps/[project-name]/frontend',
vite:config   cacheDir: '/workspaces/[project]/node_modules/.vite/apps/frontend',
vite:config   server: {
vite:config     preTransformRequests: true,
vite:config     port: 4200,
vite:config     host: 'localhost',
vite:config     sourcemapIgnoreList: [Function: isInNodeModules$1],
vite:config     middlewareMode: false,
vite:config     fs: {
vite:config       strict: true,
vite:config       allow: [Array],
vite:config       deny: [Array],
vite:config       cachedChecks: undefined
vite:config     }
vite:config   },
vite:config   preview: {
vite:config     port: 4300,
vite:config     strictPort: undefined,
vite:config     host: 'localhost',
vite:config     https: undefined,
vite:config     open: undefined,
vite:config     proxy: undefined,
vite:config     cors: undefined,
vite:config     headers: undefined
vite:config   },
vite:config   plugins: [
vite:config     'vite:optimized-deps',
vite:config     'vite:watch-package-data',
vite:config     'vite:pre-alias',
vite:config     'alias',
vite:config     'vite:react-swc:resolve-runtime',
vite:config     'vite:modulepreload-polyfill',
vite:config     'vite:resolve',
vite:config     'vite:html-inline-proxy',
vite:config     'vite:css',
vite:config     'vite:json',
vite:config     'vite:wasm-helper',
vite:config     'vite:worker',
vite:config     'vite:asset',
vite:config     'vite:react-swc',
vite:config     'nx-vite-ts-paths',
vite:config     'vite:wasm-fallback',
vite:config     'vite:define',
vite:config     'vite:css-post',
vite:config     'vite:worker-import-meta-url',
vite:config     'vite:asset-import-meta-url',
vite:config     'vite:dynamic-import-vars',
vite:config     'vite:import-glob',
vite:config     'vite:client-inject',
vite:config     'vite:css-analysis',
vite:config     'vite:import-analysis'
vite:config   ],
vite:config   build: {
vite:config     target: [ 'es2020', 'edge88', 'firefox78', 'chrome87', 'safari14' ],
vite:config     cssTarget: [ 'es2020', 'edge88', 'firefox78', 'chrome87', 'safari14' ],
vite:config     outDir: '../../../dist/apps/frontend',
vite:config     assetsDir: 'assets',
vite:config     assetsInlineLimit: 4096,
vite:config     cssCodeSplit: true,
vite:config     sourcemap: false,
vite:config     rollupOptions: {},
vite:config     minify: 'esbuild',
vite:config     terserOptions: {},
vite:config     write: true,
vite:config     emptyOutDir: true,
vite:config     copyPublicDir: true,
vite:config     manifest: false,
vite:config     lib: false,
vite:config     ssr: false,
vite:config     ssrManifest: false,
vite:config     ssrEmitAssets: false,
vite:config     reportCompressedSize: true,
vite:config     chunkSizeWarningLimit: 500,
vite:config     watch: null,
vite:config     commonjsOptions: {
vite:config       include: [Array],
vite:config       extensions: [Array],
vite:config       transformMixedEsModules: true
vite:config     },
vite:config     dynamicImportVarsOptions: { warnOnError: true, exclude: [Array] },
vite:config     modulePreload: { polyfill: true },
vite:config     cssMinify: true
vite:config   },
vite:config   test: {
vite:config     globals: true,
vite:config     cache: { dir: '../../../node_modules/.vitest' },
vite:config     environment: 'jsdom',
vite:config     include: [ 'src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}' ],
vite:config     reporters: [ 'default' ],
vite:config     coverage: {
vite:config       reportsDirectory: '../../../coverage/apps/frontend',
vite:config       provider: 'v8'
vite:config     }
vite:config   },
vite:config   configFile: '/workspaces/[project]/apps/[project-name]/frontend/vite.config.ts',
vite:config   optimizeDeps: {
vite:config     holdUntilCrawlEnd: true,
vite:config     force: undefined,
vite:config     include: [ 'react/jsx-dev-runtime' ],
vite:config     esbuildOptions: { preserveSymlinks: false, jsx: 'automatic' }
vite:config   },
vite:config   esbuild: false,
vite:config   configFileDependencies: [ '/workspaces/[project]/apps/[project-name]/frontend/vite.config.ts' ],
vite:config   inlineConfig: {
vite:config     root: undefined,
vite:config     base: undefined,
vite:config     mode: undefined,
vite:config     configFile: 'apps/[project-name]/frontend/vite.config.ts',
vite:config     logLevel: undefined,
vite:config     clearScreen: undefined,
vite:config     optimizeDeps: { force: undefined },
vite:config     server: { host: undefined }
vite:config   },
vite:config   base: '/',
vite:config   rawBase: '/',
vite:config   resolve: {
vite:config     mainFields: [ 'browser', 'module', 'jsnext:main', 'jsnext' ],
vite:config     conditions: [],
vite:config     extensions: [
vite:config       '.mjs',  '.js',
vite:config       '.mts',  '.ts',
vite:config       '.jsx',  '.tsx',
vite:config       '.json'
vite:config     ],
vite:config     dedupe: [],
vite:config     preserveSymlinks: false,
vite:config     alias: [ [Object], [Object] ]
vite:config   },
vite:config   publicDir: '/workspaces/[project]/apps/[project-name]/frontend/public',
vite:config   command: 'serve',
vite:config   mode: 'development',
vite:config   ssr: {
vite:config     target: 'node',
vite:config     optimizeDeps: { noDiscovery: true, esbuildOptions: [Object] }
vite:config   },
vite:config   isWorker: false,
vite:config   mainConfig: null,
vite:config   bundleChain: [],
vite:config   isProduction: false,
vite:config   css: { lightningcss: undefined },
vite:config   envDir: '/workspaces/[project]/apps/[project-name]/frontend',
vite:config   env: { BASE_URL: '/', MODE: 'development', DEV: true, PROD: false },
vite:config   assetsInclude: [Function: assetsInclude],
vite:config   logger: {
vite:config     hasWarned: false,
vite:config     info: [Function: info],
vite:config     warn: [Function: warn],
vite:config     warnOnce: [Function: warnOnce],
vite:config     error: [Function: error],
vite:config     clearScreen: [Function: clearScreen],
vite:config     hasErrorLogged: [Function: hasErrorLogged]
vite:config   },
vite:config   packageCache: Map(4) {
vite:config     'fnpd_/workspaces/[project]' => {
vite:config       dir: '/workspaces/[project]',
vite:config       data: [Object],
vite:config       hasSideEffects: [Function: hasSideEffects],
vite:config       webResolvedImports: {},
vite:config       nodeResolvedImports: {},
vite:config       setResolvedCache: [Function: setResolvedCache],
vite:config       getResolvedCache: [Function: getResolvedCache]
vite:config     },
vite:config     'fnpd_/workspaces/[project]/apps/[project-name]/frontend' => {
vite:config       dir: '/workspaces/[project]',
vite:config       data: [Object],
vite:config       hasSideEffects: [Function: hasSideEffects],
vite:config       webResolvedImports: {},
vite:config       nodeResolvedImports: {},
vite:config       setResolvedCache: [Function: setResolvedCache],
vite:config       getResolvedCache: [Function: getResolvedCache]
vite:config     },
vite:config     'fnpd_/workspaces/[project]/apps/[project-name]' => {
vite:config       dir: '/workspaces/[project]',
vite:config       data: [Object],
vite:config       hasSideEffects: [Function: hasSideEffects],
vite:config       webResolvedImports: {},
vite:config       nodeResolvedImports: {},
vite:config       setResolvedCache: [Function: setResolvedCache],
vite:config       getResolvedCache: [Function: getResolvedCache]
vite:config     },
vite:config     'fnpd_/workspaces/[project]/apps' => {
vite:config       dir: '/workspaces/[project]',
vite:config       data: [Object],
vite:config       hasSideEffects: [Function: hasSideEffects],
vite:config       webResolvedImports: {},
vite:config       nodeResolvedImports: {},
vite:config       setResolvedCache: [Function: setResolvedCache],
vite:config       getResolvedCache: [Function: getResolvedCache]
vite:config     },
vite:config     set: [Function (anonymous)]
vite:config   },
vite:config   createResolver: [Function: createResolver],
vite:config   worker: { format: 'iife', plugins: '() => plugins', rollupOptions: {} },
vite:config   appType: 'spa',
vite:config   experimental: { importGlobRestoreExtension: false, hmrPartialAccept: false },
vite:config   getSortedPlugins: [Function: getSortedPlugins],
vite:config   getSortedPluginHooks: [Function: getSortedPluginHooks]
vite:config } +7ms
vite:deps removing old cache dir /workspaces/[project]/node_modules/.vite/apps/frontend/deps +0ms
vite:resolve 1.40ms react/jsx-dev-runtime -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/react/jsx-dev-runtime.js +0ms
vite:deps scanning for dependencies... +0ms

VITE v5.2.8  ready in 227 ms

➜  Local:   http://localhost:4200/
➜  press h + enter to show help
vite:deps Crawling dependencies using entries: 
vite:deps   /workspaces/[project]/apps/[project-name]/frontend/index.html +0ms
vite:resolve 0.14ms /src/main.tsx -> /workspaces/[project]/apps/[project-name]/frontend/src/main.tsx +0ms
vite:resolve 0.59ms react -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/react/index.js +1ms
vite:resolve 0.31ms react-dom/client -> /workspaces/[project]/node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/client.js +1ms
vite:resolve 0.21ms ./app/app.js -> /workspaces/[project]/apps/[project-name]/frontend/src/app/app.tsx +0ms
vite:resolve 0.12ms react/jsx-runtime -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/react/jsx-runtime.js +1ms
vite:resolve 0.29ms @refinedev/core -> /workspaces/[project]/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]_6pxxytl5k5ch475savoid6giru/node_modules/@refinedev/core/dist/index.mjs +1ms
vite:resolve 0.24ms @refinedev/react-router-v6 -> /workspaces/[project]/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_react-do_6iphdtncvs4c4jzbmmulo3nodi/node_modules/@refinedev/react-router-v6/dist/index.mjs +0ms
vite:resolve 0.26ms react-router-dom -> /workspaces/[project]/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/react-router-dom/dist/index.js +1ms
vite:resolve 0.69ms @my-scope/utility.app-framework -> /workspaces/[project]/libs/shared/utility/app-framework/src/index.ts +1ms
vite:resolve 0.30ms @my-scope/ui.language-toggler -> /workspaces/[project]/libs/shared/ui/language-toggler/src/index.ts +0ms
vite:resolve 0.20ms @my-scope/ui.layout-framework -> /workspaces/[project]/libs/shared/ui/layout-framework/src/index.ts +0ms
vite:resolve 0.15ms @my-scope/ui.theme-toggler -> /workspaces/[project]/libs/shared/ui/theme-toggler/src/index.ts +1ms
vite:resolve 0.15ms ./demo-pages.js -> /workspaces/[project]/apps/[project-name]/frontend/src/app/demo-pages.tsx +0ms
vite:resolve 0.08ms ./nav-links.js -> /workspaces/[project]/apps/[project-name]/frontend/src/app/nav-links.tsx +0ms
vite:resolve 0.07ms ./refine-data-provider-demo-pages.js -> /workspaces/[project]/apps/[project-name]/frontend/src/app/refine-data-provider-demo-pages.tsx +1ms
vite:resolve 0.10ms ./tailwind-demo.js -> /workspaces/[project]/apps/[project-name]/frontend/src/app/tailwind-demo.tsx +0ms
vite:resolve 0.42ms ./lib/app-framework.js -> /workspaces/[project]/libs/shared/utility/app-framework/src/lib/app-framework.tsx +2ms
vite:resolve 0.43ms ./theme-toggler.js -> /workspaces/[project]/libs/shared/ui/theme-toggler/src/theme-toggler.tsx +0ms
vite:resolve 0.54ms ./lib/layout/layout-framework.js -> /workspaces/[project]/libs/shared/ui/layout-framework/src/lib/layout/layout-framework.tsx +0ms
vite:resolve 0.53ms ./language-toggler.js -> /workspaces/[project]/libs/shared/ui/language-toggler/src/language-toggler.tsx +0ms
vite:resolve 0.71ms @my-scope/ui.common-components -> /workspaces/[project]/libs/shared/ui/common-components/src/index.ts +1ms
vite:resolve 0.16ms ./lib/sidebar/use-sidebar.js -> /workspaces/[project]/libs/shared/ui/layout-framework/src/lib/sidebar/use-sidebar.ts +0ms
vite:resolve 0.21ms @my-scope/utility.i18n-provider -> /workspaces/[project]/libs/shared/utility/i18n-provider/src/index.ts +0ms
vite:resolve 0.68ms clsx -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/clsx/dist/clsx.mjs +3ms
vite:resolve 0.66ms @refinedev/simple-rest -> /workspaces/[project]/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_react-dom@18_c54xwoen2nedooby5kmv3stjx4/node_modules/@refinedev/simple-rest/dist/index.mjs +0ms
vite:resolve 0.41ms ../layout/layout-context.js -> /workspaces/[project]/libs/shared/ui/layout-framework/src/lib/layout/layout-context.ts +0ms
vite:resolve 0.41ms ../content/content.js -> /workspaces/[project]/libs/shared/ui/layout-framework/src/lib/content/content.tsx +0ms
vite:resolve 0.50ms @my-scope/utility.theme-framework -> /workspaces/[project]/libs/shared/utility/theme-framework/src/index.ts +1ms
vite:resolve 0.60ms ./button/button.js -> /workspaces/[project]/libs/shared/ui/common-components/src/button/button.tsx +0ms
vite:resolve 0.60ms react-i18next -> /workspaces/[project]/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/react-i18next/dist/es/index.js +0ms
vite:resolve 0.60ms ../footer/footer.js -> /workspaces/[project]/libs/shared/ui/layout-framework/src/lib/footer/footer.tsx +0ms
vite:resolve 0.53ms ./i18n.js -> /workspaces/[project]/libs/shared/utility/i18n-provider/src/i18n.ts +1ms
vite:resolve 0.53ms ./links/link-button.js -> /workspaces/[project]/libs/shared/ui/common-components/src/links/link-button.tsx +0ms
vite:resolve 0.52ms ../header/header.js -> /workspaces/[project]/libs/shared/ui/layout-framework/src/lib/header/header.tsx +0ms
vite:resolve 0.32ms ./register-locales.js -> /workspaces/[project]/libs/shared/utility/i18n-provider/src/register-locales.ts +1ms
vite:resolve 0.32ms ./links/nav-link-button.js -> /workspaces/[project]/libs/shared/ui/common-components/src/links/nav-link-button.tsx +0ms
vite:resolve 0.32ms ../navbar/navbar.js -> /workspaces/[project]/libs/shared/ui/layout-framework/src/lib/navbar/navbar.tsx +0ms
vite:resolve 0.33ms ../sidebar/sidebar.js -> /workspaces/[project]/libs/shared/ui/layout-framework/src/lib/sidebar/sidebar.tsx +1ms
vite:resolve 0.39ms @my-scope/utility.auth-provider -> /workspaces/[project]/libs/shared/utility/auth-provider/src/index.ts +0ms
vite:resolve 0.41ms ./layout-provider.js -> /workspaces/[project]/libs/shared/ui/layout-framework/src/lib/layout/layout-provider.tsx +0ms
vite:resolve 0.39ms ./theme-provider.js -> /workspaces/[project]/libs/shared/utility/theme-framework/src/theme-provider.tsx +0ms
vite:resolve 0.21ms ./layout-state.js -> /workspaces/[project]/libs/shared/ui/layout-framework/src/lib/layout/layout-state.ts +1ms
vite:resolve 0.37ms i18next -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/i18next/dist/esm/i18next.js +1ms
vite:resolve 0.66ms ./button-variants.js -> /workspaces/[project]/libs/shared/ui/common-components/src/button/button-variants.ts +1ms
vite:resolve 0.64ms i18next-browser-languagedetector -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/i18next-browser-languagedetector/dist/esm/i18nextBrowserLanguageDetector.js +0ms
vite:resolve 0.64ms ./layout-context.js -> /workspaces/[project]/libs/shared/ui/layout-framework/src/lib/layout/layout-context.ts +0ms
vite:resolve 0.61ms ./lib/auth-provider.js -> /workspaces/[project]/libs/shared/utility/auth-provider/src/lib/auth-provider.ts +0ms
vite:resolve 0.44ms ../navbar/navbar-state.js -> /workspaces/[project]/libs/shared/ui/layout-framework/src/lib/navbar/navbar-state.ts +1ms
vite:resolve 0.38ms ../navbar/use-navbar-provider-state.js -> /workspaces/[project]/libs/shared/ui/layout-framework/src/lib/navbar/use-navbar-provider-state.ts +0ms
vite:resolve 0.39ms ./lib/auth-backend.dummy.js -> /workspaces/[project]/libs/shared/utility/auth-provider/src/lib/auth-backend.dummy.ts +0ms
vite:resolve 0.35ms ../navbar/use-navbar.js -> /workspaces/[project]/libs/shared/ui/layout-framework/src/lib/navbar/use-navbar.ts +1ms
vite:resolve 0.33ms ./link-button.js -> /workspaces/[project]/libs/shared/ui/common-components/src/links/link-button.tsx +0ms
vite:resolve 0.33ms ../button/button.js -> /workspaces/[project]/libs/shared/ui/common-components/src/button/button.tsx +0ms
vite:resolve 0.43ms ./lib/auth-backend.js -> /workspaces/[project]/libs/shared/utility/auth-provider/src/lib/auth-backend.ts +0ms
vite:resolve 0.44ms ../sidebar/use-sidebar-provider-state.js -> /workspaces/[project]/libs/shared/ui/layout-framework/src/lib/sidebar/use-sidebar-provider-state.ts +0ms
vite:resolve 0.44ms ../sidebar/sidebar-state.js -> /workspaces/[project]/libs/shared/ui/layout-framework/src/lib/sidebar/sidebar-state.ts +0ms
vite:resolve 0.41ms ./main-nav.js -> /workspaces/[project]/libs/shared/ui/layout-framework/src/lib/header/main-nav.tsx +0ms
vite:resolve 0.39ms ./use-sidebar.js -> /workspaces/[project]/libs/shared/ui/layout-framework/src/lib/sidebar/use-sidebar.ts +0ms
vite:resolve 0.21ms ./search.js -> /workspaces/[project]/libs/shared/ui/layout-framework/src/lib/header/search.tsx +1ms
vite:resolve 0.22ms ./navbar-section.js -> /workspaces/[project]/libs/shared/ui/layout-framework/src/lib/navbar/navbar-section.tsx +0ms
vite:resolve 0.12ms ./team-switcher.js -> /workspaces/[project]/libs/shared/ui/layout-framework/src/lib/header/team-switcher.tsx +0ms
vite:resolve 0.12ms ./use-navbar.js -> /workspaces/[project]/libs/shared/ui/layout-framework/src/lib/navbar/use-navbar.ts +1ms
vite:resolve 0.11ms ./user-nav.js -> /workspaces/[project]/libs/shared/ui/layout-framework/src/lib/header/user-nav.tsx +0ms
vite:resolve 0.55ms tailwind-variants -> /workspaces/[project]/node_modules/.pnpm/[email protected][email protected][email protected]_@[email protected]_@[email protected]__giqdzdxzfxz42nlzepa4eepznm/node_modules/tailwind-variants/dist/index.js +1ms
vite:resolve 0.56ms http-status-codes -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/http-status-codes/build/es/index.js +0ms
vite:resolve 0.13ms ./navbar-state.js -> /workspaces/[project]/libs/shared/ui/layout-framework/src/lib/navbar/navbar-state.ts +1ms
vite:resolve 0.13ms ./sidebar-state.js -> /workspaces/[project]/libs/shared/ui/layout-framework/src/lib/sidebar/sidebar-state.ts +0ms
vite:resolve 0.19ms ./navbar-link.js -> /workspaces/[project]/libs/shared/ui/layout-framework/src/lib/navbar/navbar-link.tsx +1ms
vite:deps Scan completed in 214.83ms: 
vite:deps   @refinedev/core -> /workspaces/[project]/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]_6pxxytl5k5ch475savoid6giru/node_modules/@refinedev/core/dist/index.mjs
vite:deps   @refinedev/react-router-v6 -> /workspaces/[project]/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_react-do_6iphdtncvs4c4jzbmmulo3nodi/node_modules/@refinedev/react-router-v6/dist/index.mjs
vite:deps   @refinedev/simple-rest -> /workspaces/[project]/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_react-dom@18_c54xwoen2nedooby5kmv3stjx4/node_modules/@refinedev/simple-rest/dist/index.mjs
vite:deps   clsx -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/clsx/dist/clsx.mjs
vite:deps   http-status-codes -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/http-status-codes/build/es/index.js
vite:deps   i18next -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/i18next/dist/esm/i18next.js
vite:deps   i18next-browser-languagedetector -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/i18next-browser-languagedetector/dist/esm/i18nextBrowserLanguageDetector.js
vite:deps   react -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/react/index.js
vite:deps   react-dom/client -> /workspaces/[project]/node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/client.js
vite:deps   react-i18next -> /workspaces/[project]/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/react-i18next/dist/es/index.js
vite:deps   react-router-dom -> /workspaces/[project]/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/react-router-dom/dist/index.js
vite:deps   react/jsx-runtime -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/react/jsx-runtime.js
vite:deps   tailwind-variants -> /workspaces/[project]/node_modules/.pnpm/[email protected][email protected][email protected]_@[email protected]_@[email protected]__giqdzdxzfxz42nlzepa4eepznm/node_modules/tailwind-variants/dist/index.js +202ms
vite:deps creating package.json in /workspaces/[project]/node_modules/.vite/apps/frontend/deps_temp_66cdbcff +224ms
vite:resolve 0.47ms react-dom -> /workspaces/[project]/node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/index.js +0ms
vite:resolve 0.29ms query-string -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/query-string/index.js +0ms
vite:resolve 0.72ms react -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/react/index.js +1ms
vite:resolve 0.76ms @babel/runtime/helpers/esm/classCallCheck -> /workspaces/[project]/node_modules/.pnpm/@[email protected]/node_modules/@babel/runtime/helpers/esm/classCallCheck.js +0ms
vite:resolve 0.56ms axios -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/axios/index.js +1ms
vite:resolve 0.35ms @refinedev/core -> /workspaces/[project]/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]_6pxxytl5k5ch475savoid6giru/node_modules/@refinedev/core/dist/index.mjs +0ms
vite:resolve 0.37ms @babel/runtime/helpers/esm/createClass -> /workspaces/[project]/node_modules/.pnpm/@[email protected]/node_modules/@babel/runtime/helpers/esm/createClass.js +0ms
vite:resolve 0.84ms qs -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/qs/lib/index.js +3ms
vite:resolve 0.86ms tailwind-merge -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/tailwind-merge/dist/bundle-mjs.mjs +0ms
vite:resolve 1.20ms react -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/react/index.js +8ms
vite:resolve 1.22ms strict-uri-encode -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/strict-uri-encode/index.js +0ms
vite:resolve 1.24ms react-router-dom -> /workspaces/[project]/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/react-router-dom/dist/index.js +2ms
vite:resolve 0.30ms react-dom -> /workspaces/[project]/node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/index.js +0ms
vite:resolve 0.53ms decode-uri-component -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/decode-uri-component/index.js +1ms
vite:resolve 0.44ms react-router -> /workspaces/[project]/node_modules/.pnpm/[email protected][email protected]/node_modules/react-router/dist/index.js +2ms
vite:resolve 0.47ms split-on-first -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/split-on-first/index.js +1ms
vite:resolve 0.43ms filter-obj -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/filter-obj/index.js +1ms
vite:resolve 0.37ms @remix-run/router -> /workspaces/[project]/node_modules/.pnpm/@[email protected]/node_modules/@remix-run/router/dist/router.js +1ms
vite:resolve 0.25ms html-parse-stringify -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/html-parse-stringify/dist/html-parse-stringify.module.js +0ms
vite:resolve 0.26ms side-channel -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/side-channel/index.js +1ms
vite:resolve 0.19ms void-elements -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/void-elements/index.js +1ms
vite:resolve 0.30ms get-intrinsic -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/get-intrinsic/index.js +2ms
vite:resolve 0.19ms call-bind/callBound -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/call-bind/callBound.js +0ms
vite:resolve 0.18ms object-inspect -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/object-inspect/index.js +1ms
vite:resolve 0.17ms es-errors/type -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/es-errors/type.js +0ms
vite:resolve 0.16ms es-errors -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/es-errors/index.js +1ms
vite:resolve 0.32ms function-bind -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/function-bind/index.js +1ms
vite:resolve 0.10ms es-errors/eval -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/es-errors/eval.js +0ms
vite:resolve 0.07ms es-errors/range -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/es-errors/range.js +0ms
vite:resolve 0.18ms set-function-length -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/set-function-length/index.js +0ms
vite:resolve 0.28ms es-errors/ref -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/es-errors/ref.js +1ms
vite:resolve 0.19ms es-errors/syntax -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/es-errors/syntax.js +0ms
vite:resolve 0.27ms es-define-property -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/es-define-property/index.js +0ms
vite:resolve 0.22ms es-errors/uri -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/es-errors/uri.js +1ms
vite:resolve 0.29ms has-symbols -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/has-symbols/index.js +0ms
vite:resolve 0.30ms define-data-property -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/define-data-property/index.js +1ms
vite:resolve 0.32ms has-proto -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/has-proto/index.js +0ms
vite:resolve 0.30ms has-property-descriptors -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/has-property-descriptors/index.js +0ms
vite:resolve 0.28ms @refinedev/devtools-internal -> /workspaces/[project]/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_react-dom@18_z7ueuktsdfo7rbo7vhgur3irpm/node_modules/@refinedev/devtools-internal/dist/index.mjs +9ms
vite:resolve 0.27ms gopd -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/gopd/index.js +1ms
vite:resolve 0.29ms hasown -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/hasown/index.js +0ms
vite:resolve 0.48ms @tanstack/react-query -> /workspaces/[project]/node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@tanstack/react-query/build/lib/index.mjs +1ms
vite:resolve 0.48ms lodash-es/differenceWith.js -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/lodash-es/differenceWith.js +1ms
vite:resolve 0.11ms lodash-es/unionWith.js -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/lodash-es/unionWith.js +1ms
vite:resolve 0.31ms warn-once -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/warn-once/index.js +1ms
vite:resolve 0.09ms lodash-es/fromPairs.js -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/lodash-es/fromPairs.js +0ms
vite:resolve 0.08ms lodash-es/zip.js -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/lodash-es/zip.js +0ms
vite:resolve 0.19ms pluralize -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/pluralize/pluralize.js +1ms
vite:resolve 0.08ms lodash-es/debounce.js -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/lodash-es/debounce.js +0ms
vite:resolve 0.08ms lodash-es/isEqual.js -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/lodash-es/isEqual.js +0ms
vite:resolve 0.20ms papaparse -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/papaparse/papaparse.min.js +0ms
vite:resolve 0.09ms lodash-es/chunk.js -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/lodash-es/chunk.js +1ms
vite:resolve 0.08ms lodash-es/get.js -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/lodash-es/get.js +0ms
vite:resolve 0.08ms lodash-es/uniqBy.js -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/lodash-es/uniqBy.js +0ms
vite:resolve 0.38ms @tanstack/query-core -> /workspaces/[project]/node_modules/.pnpm/@[email protected]/node_modules/@tanstack/query-core/build/lib/index.mjs +16ms
vite:resolve 0.34ms error-stack-parser -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/error-stack-parser/error-stack-parser.js +0ms
vite:resolve 0.29ms @refinedev/devtools-shared -> /workspaces/[project]/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]_y4bs4d4fl4msl4bjbmpvaw4opu/node_modules/@refinedev/devtools-shared/dist/index.mjs +2ms
vite:resolve 1.53ms scheduler -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/scheduler/index.js +27ms
vite:resolve 1.57ms stackframe -> /workspaces/[project]/node_modules/.pnpm/[email protected]/node_modules/stackframe/stackframe.js +0ms
vite:resolve 0.28ms use-sync-external-store/shim/index.js -> /workspaces/[project]/node_modules/.pnpm/[email protected][email protected]/node_modules/use-sync-external-store/shim/index.js +6ms
vite:deps Dependencies bundled in 120.62ms +123ms

Validations

@mrjackwills
Copy link

mrjackwills commented Apr 24, 2024

I had this same issue, there is a note about a windows container bug in the Docker release notes. They suggest using a ~/.config/daemon.json file to alter the default behavior - however in my system this still doesn't fix the issue.

But, the solution that worked for me was to run it with the --host argument, which then informs me I am able to connect via

➜  Local:   http://localhost:8002/
➜  Network: http://172.17.0.2:8002/

However, I am only able to connect via the first, localhost option (either http://127.0.0.1:8002 or http://localhost:8002). Without the --host argument, much like you describe, it is impossible to connect to the vite dev server at all.

EDIT: This issues seems only related to vite. When using another Docker dev Container, which exposes port 8282 to the host in a none vite environment, I am able to connect to the server correctly.

Running vite with --host 127.0.0.1 works, and only exposes locally.

This can also be achieved by editing the vite.config.ts to include

server: {
    port: 8002,
    host: '127.0.0.1'
}

I think that vite needs to change behaviour to use as default 127.0.0.1 instead of 0.0.0.0, but I am not sure what unintended consequences this would have

FlippinBerger added a commit to FlippinBerger/djmocracy that referenced this issue Apr 25, 2024
Vite currently isn't working in a Docker environment for development following along here:  vitejs/vite#16522
Going to commit these files as placeholders, and probably still containerize the backend/db together even if I can't get Nuxt in there yet.
@bluwy
Copy link
Member

bluwy commented Apr 29, 2024

Could this be related to ipv4 and ipv6? The host in Vite is "localhost" by default, which internally in Node, it resolves to either 127.0.0.1 or ::1 depending on the system. After starting the dev/preview server without --host, maybe you can explicitly access http://127.0.0.1:8002/ or http://[::1]:8002/ manually to see if it works.

@mrjackwills
Copy link

Could this be related to ipv4 and ipv6? The host in Vite is "localhost" by default, which internally in Node, it resolves to either 127.0.0.1 or ::1 depending on the system. After starting the dev/preview server without --host, maybe you can explicitly access http://127.0.0.1:8002/ or http://[::1]:8002/ manually to see if it works.

I just tried this, but was unable to connect over ipv6 via http://[::1]:8002/, nor still at http://127.0.0.1:8002/.

In my particular scenario, setting host: '127.0.0.1' in vite.config.ts still seems the quickest and easiest solution.

@JonathonRP
Copy link

I tried this because I've tried upgrading and downgrading everything and nothing has worked this after I had rebuilt my dev container and these steps have not resolved my issue...

@sharky98
Copy link
Author

Could this be related to ipv4 and ipv6? The host in Vite is "localhost" by default, which internally in Node, it resolves to either 127.0.0.1 or ::1 depending on the system. After starting the dev/preview server without --host, maybe you can explicitly access http://127.0.0.1:8002/ or http://[::1]:8002/ manually to see if it works.

I just tried this, but was unable to connect over ipv6 via http://[::1]:8002/, nor still at http://127.0.0.1:8002/.

In my particular scenario, setting host: '127.0.0.1' in vite.config.ts still seems the quickest and easiest solution.

Seems to do the trick for me.

Having Vite using host: "127.0.0.1" inside a dev container, I am able to access through http://localhost:4200/ on the host. However, using an explicit host: "localhost" does not work.

@sapphi-red
Copy link
Member

It seems docker v26 started to return ::1 for localhost even if the host only uses IPv4.
https://github.com/moby/moby/releases/tag/v26.0.0#:~:text=Always%20attempt%20to,include%20IPv6%20entries
So in the container Vite listens on ::1 (because localhost resolves to ::1). But on the host machine, localhost resolves to 127.0.0.1.
Does adding "runArgs": ["--sysctl net.ipv6.conf.all.disable_ipv6=1"] to .devcontainer.json work? If it does, I think it's caused by that change.

@mrjackwills
Copy link

Yes, using "runArgs":["--sysctl", "net.ipv6.conf.all.disable_ipv6=1"], I am able to connect to the dev server as before.

Again, I still think that setting host: '127.0.0.1' in vite.config.ts seems the quickest and easiest solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants