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

[Turbopack] weird node_modules import issue #6483

Closed
westlakem opened this issue Nov 16, 2023 · 7 comments
Closed

[Turbopack] weird node_modules import issue #6483

westlakem opened this issue Nov 16, 2023 · 7 comments
Labels
kind: bug Something isn't working

Comments

@westlakem
Copy link

westlakem commented Nov 16, 2023

What version of Turbopack are you using?

unsure, NextJS v 14.0.2

What package manager are you using / does the bug impact?

pnpm

What operating system are you using?

Windows

Describe the Bug

import code (my global.scss file):
image

node_modules directory:
image

Error message:
image

Expected Behavior

It should import and be used like it does when I don't use Turbopack, and the website should render.

image

To Reproduce

install bootstrap-icons and try to use them in a scss project

Reproduction Repo

No response

@westlakem westlakem added kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage owned-by: turborepo labels Nov 16, 2023
@chris-olszewski
Copy link
Member

Hi, just confirming I'm understanding:
In the workspace directory: pnpm run dev works as expected, but turbo run dev results in a failure?

You can get the version of Turborepo that you're using with turbo --version. Due to the nature of this issue, I probably won't be able to help without a reproduction repo. If you could provide one that would be very beneficial.

@chris-olszewski chris-olszewski added needs: author input and removed needs: triage New issues get this label. Remove it after triage labels Nov 17, 2023
@westlakem
Copy link
Author

Hi, just confirming I'm understanding: In the workspace directory: pnpm run dev works as expected, but turbo run dev results in a failure?

You can get the version of Turborepo that you're using with turbo --version. Due to the nature of this issue, I probably won't be able to help without a reproduction repo. If you could provide one that would be very beneficial.

pnpm run dev --turbo is the command that doesn't work. Unfortunately turbo isn't listed in my dependency tree, and running turbo from the command line results in bash: turbo: command not found. Unfortunately this is for a corporate application and I only recently tried running turbo on the app. I'm going to be honest with you, I don't know when I'm going to find the time to create a repo to reproduce the issue. Maybe a new project with bootstrap only would cause the issue?

@chris-olszewski
Copy link
Member

Ah gotcha, this is an issue with turbopack. I'll label it as such and alert the team.

@chris-olszewski chris-olszewski changed the title turbo weird node_modules import issue [Turbopack] weird node_modules import issue Nov 17, 2023
@timneutkens
Copy link
Member

Dug a bit into this as it wasn't clear what the exact cause of the issue was.

Minimal reproduction: https://github.com/timneutkens/sass-resolve-issue

The underlying issue is that all url()s are resolved relative to the root file that started the Sass compilation. This means that when you try to reference a relative file it's always resolved relative to the entrypoint file, not the current file being compiled. That is a bug that we'll have to investigate.

@ForsakenHarmony
Copy link
Contributor

Might be the same / similar issue as vercel/next.js#60088

@timneutkens
Copy link
Member

Next.js with Turbopack is now passing all tests we have for Sass support, including importing external packages 🙌

Please give it a try using npm install next@canary and let me know if you're running into anything else.

@ForsakenHarmony
Copy link
Contributor

Closing for now as it should be fixed, feel free to create a new issue in the next.js repo

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

No branches or pull requests

4 participants