Skip to content

Tailwindcss conflicts with new env handling #5720

@fehnomenal

Description

@fehnomenal

Describe the bug

I'm using tailwind and have the following app.css:

@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  @font-face {
    font-family: 'Oswald';
    src: url(/fonts/oswald/Oswald-VariableFont_wght.woff2) format('woff2'),
      url(/fonts/oswald/Oswald-VariableFont_wght.ttf) format('truetype');
    font-display: swap;
  }
}

Now all layouts that import the css file throw this error:

Error: Cannot import $env/static/private.js into client-side code:
- src/routes/[email protected] 
  - src/app.css 
    - src/init/index.ts 
      - src/lib/import/afterbuy-import-jobs.ts 
        - src/lib/import/afterbuy-catalogs/pipeline.ts 
          - src/lib/import/afterbuy-catalogs/stream-from-afterbuy.ts 
            - src/lib/afterbuy.ts 
              - $env/static/private.js

When I remove the tailwind directives or the whole import everything works but the styles are broken of course.

Reproduction

Just add the default tailwind css directives.

Logs

No response

System Info

  System:
    OS: Linux 5.15 NixOS 22.11 (Raccoon) 22.11 (Raccoon)
    CPU: (8) x64 Intel(R) Core(TM) i7-7700T CPU @ 2.90GHz
    Memory: 16.14 GB / 31.28 GB
    Container: Yes
    Shell: 5.1.16 - /run/current-system/sw/bin/bash
  Binaries:
    Node: 14.20.0 - /nix/store/fg072dha8d8nfhzcsxxr1nybx64pxgp1-nodejs-14.20.0/bin/node
    npm: 6.14.17 - /nix/store/fg072dha8d8nfhzcsxxr1nybx64pxgp1-nodejs-14.20.0/bin/npm
  Browsers:
    Chromium: 103.0.5060.114
    Firefox: 102.0.1
  npmPackages:
    @sveltejs/adapter-node: 1.0.0-next.85 => 1.0.0-next.85 
    @sveltejs/kit: 1.0.0-next.395 => 1.0.0-next.395 
    svelte: ~3.49.0 => 3.49.0 
    vite: ~3.0.0 => 3.0.0

Severity

blocking an upgrade

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions