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

"Ignoring remote @import of <url>" message during build #1845

Closed
3 tasks done
scambier opened this issue Feb 2, 2021 · 1 comment
Closed
3 tasks done

"Ignoring remote @import of <url>" message during build #1845

scambier opened this issue Feb 2, 2021 · 1 comment

Comments

@scambier
Copy link

scambier commented Feb 2, 2021

⚠️ IMPORTANT ⚠️ Please check the following list before proceeding. If you ignore this issue template, your issue will be directly closed.

  • Read the docs.
  • Use Vite >=2.0. (1.x is no longer supported)
  • If the issue is related to 1.x -> 2.0 upgrade, read the Migration Guide first.

Describe the bug

The dependency we use to import company styles does a @import of a google font url:

@import url("https://fonts.googleapis.com/css?family=Open+Sans:200,200i,400,400i,500,500i,600,600i,700,700i,900,900i&display=swap");

During the build step, the following warning appears:

warnings when minifying css:
Ignoring remote @import of "https://fonts.googleapis.com/css?family=Open+Sans:200,200i,400,400i,500,500i,600,600i,700,700i,900,900i&display=swap" as no callback given and after other content.

And indeed, the font is not imported in the dist build, resulting in a visual difference between the npm run serve and the build.

Reproduction

https://github.com/scambier/test-vite-app/tree/8ff2fd4783aa3b025fbfce283236f927071f22c1

The @import is in App.vue

  • clone
  • npm install
  • npm run dev => The font is Open Sans
  • npm run build => The warning appears
  • start a local server in ./dist => Open Sans is not loaded, the font is serif

System Info

  • vite version: 2.0.0-beta.61
  • Operating System: Windows 10
  • Node version: 14.15.4
  • Package manager (npm/yarn/pnpm) and version: npm 6.14.10

Logs (Optional if provided reproduction)

  1. Run vite or vite build with the --debug flag.
  2. Provide the error log here.
  vite:config no config file found. +0ms
  vite:config using resolved config: {
  vite:config   root: 'C:/Users/[user]/Dev/test-vite-app/dist',
  vite:config   base: '/',
  vite:config   mode: 'production',
  vite:config   configFile: undefined,
  vite:config   logLevel: undefined,
  vite:config   clearScreen: undefined,
  vite:config   build: {
  vite:config     target: [ 'es2019', 'edge16', 'firefox60', 'chrome61', 'safari11' ],
  vite:config     polyfillDynamicImport: true,
  vite:config     outDir: 'dist',
  vite:config     assetsDir: 'assets',
  vite:config     assetsInlineLimit: 4096,
  vite:config     cssCodeSplit: true,
  vite:config     sourcemap: false,
  vite:config     rollupOptions: {},
  vite:config     commonjsOptions: { include: [Array], extensions: [Array] },
  vite:config     minify: 'terser',
  vite:config     terserOptions: {},
  vite:config     cleanCssOptions: {},
  vite:config     write: true,
  vite:config     emptyOutDir: null,
  vite:config     manifest: false,
  vite:config     lib: false,
  vite:config     ssr: false,
  vite:config     ssrManifest: false
  vite:config   },
  vite:config   inlineConfig: {
  vite:config     root: undefined,
  vite:config     base: undefined,
  vite:config     mode: undefined,
  vite:config     configFile: undefined,
  vite:config     logLevel: undefined,
  vite:config     clearScreen: undefined,
  vite:config     build: {}
  vite:config   },
  vite:config   publicDir: 'C:\\Users\\[user]\\Dev\\test-vite-app\\dist\\public',
  vite:config   command: 'build',
  vite:config   isProduction: true,
  vite:config   optimizeCacheDir: 'C:\\Users\\[user]\\Dev\\test-vite-app\\node_modules\\.vite',
  vite:config   alias: [ { find: /^\/@vite\//, replacement: [Function: replacement] } ],
  vite:config   plugins: [
  vite:config     'alias',
  vite:config     'vite:dynamic-import-polyfill',
  vite:config     'vite:resolve',
  vite:config     'vite:html',
  vite:config     'vite:css',
  vite:config     'vite:esbuild',
  vite:config     'vite:json',
  vite:config     'vite:wasm',
  vite:config     'vite:worker',
  vite:config     'vite:asset',
  vite:config     'vite:css-post',
  vite:config     'vite:build-html',
  vite:config     'commonjs',
  vite:config     'vite:data-uri',
  vite:config     'vite:define',
  vite:config     'rollup-plugin-dynamic-import-variables',
  vite:config     'vite:import-analysis',
  vite:config     'vite:esbuild-transpile',
  vite:config     'vite:terser',
  vite:config     'vite:size'
  vite:config   ],
  vite:config   server: {},
  vite:config   env: { BASE_URL: '/', MODE: 'production', DEV: false, PROD: true },
  vite:config   assetsInclude: [Function: assetsInclude],
  vite:config   logger: {
  vite:config     hasWarned: false,
  vite:config     info: [Function: info],
  vite:config     warn: [Function: warn],
  vite:config     error: [Function: error],
  vite:config     clearScreen: [Function: clearScreen]
  vite:config   },
  vite:config   createResolver: [Function: createResolver]
  vite:config } +7ms
building for production...
dist/assets/favicon.f749aae1.ico          4.19kb
dist/assets/vendor.4ead770d.f8b50b9a.js   42.32kb
dist/assets/index.a066a697.js             44.72kb / brotli: 16.01kb
dist/assets/index.60c5379a.css            0.18kb / brotli: 0.12kb
dist/index.html                           0.49kb
@scambier
Copy link
Author

scambier commented Feb 3, 2021

@yyx990803 I updated to beta 62, the warning message is gone (per your commit), but the core problem is still there: the font is not loaded.

@yyx990803 yyx990803 reopened this Feb 3, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants