question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Importing remote urls broken with v3.0.1

See original GitHub issue

With less v2.7.3 (using webpack v3.1.0 and less-loader v4.1.0) I could import remote fonts like this in my main.less file:

@import url('https://fonts.googleapis.com/css?family=Nunito');

With less v3.0.1 using the same config and dependencies I now only get this error when trying to build:

Message:
    ./node_modules/css-loader??ref--1-2!./node_modules/postcss-loader/lib??ref--1-3!./node_modules/less-loader/dist/cjs.js??ref--1-4!./src/css/main.less
Module build failed:

 */
@import url('https://fonts.googleapis.com/css?family=Nunito');
^
Can't resolve './https://fonts.googleapis.com/css?family=Nunito' in 'C:\Projekte\mine\homepage\src\css'
      in C:\Projekte\mine\homepage\src\css\main.less (line 6, column 0)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

76reactions
matthew-deancommented, Mar 20, 2018

I think this might be related to the fact that Less no longer auto-switches to a “css” import (preserving the @import statement) just because it finds a “css” string somewhere in the URL.

Try @import (css) url('https://fonts.googleapis.com/css?family=Nunito');

1reaction
seven-phases-maxcommented, Oct 30, 2019

so just wondering if I could do this with a config option instead?

No. More over the very idea of importing fonts.googleapis.com into a compiled CSS is dangerous because fonts.googleapis.com does sniff the used browser (obvoiusly Less in node will report itself as Chrome/Chromium) and may return different results depending on that (so far I did not heard of any problem in this regards but it is free to break at any moment).

Read more comments on GitHub >

github_iconTop Results From Across the Web

gitlab :import existing repository .not working correctly
Take the mygitlab URL and make it the origin url. You can just delete the mygitlab block, or via command line: git remote...
Read more >
gitlab Import url is blocked: "Requests to the local network are ...
local) as the gitlab server (gitlab. mydomain. local) via URL (Import Project/git Repo by URL), I get the message: "Import url is blocked: ......
Read more >
How to Include three.js in Your Projects
The first step in building a three.js app is importing the three.js files. There are three main ways to do this: download the...
Read more >
Recipe and Sources in the Same Repo - Conan Docs
from conans import ConanFile, CMake class HelloConan(ConanFile): name = "hello" version = "0.1" license = "<Put the package license here>" url = "<Package ......
Read more >
Robot Framework User Guide
1) Importing test libraries, resource files and variable files. ... See separate Remote library interface section for more information about this concept.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found