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

[!] Error: Unexpected character '@' (Note that you need plugins to import files that are not JavaScript) #392

Open
sp0033212000 opened this issue Aug 16, 2021 · 1 comment

Comments

@sp0033212000
Copy link

I got this error when I rollup tailwind module.

My rollup config:

import postcss from "rollup-plugin-postcss";
import typescript from "rollup-plugin-typescript2";

/**
 * @type {import("rollup").RollupOptions}
 */
const config = {
  input: "./src/index.tsx",
  output: [
    { file: "./lib/esm/index.js", format: "esm" },
    { file: "./lib/cjs/index.js", format: "cjs" },
  ],
  plugins: [
    postcss({
      config: { path: "./postcss.config.js" },
      extensions: ["css"],
      minimize: true,
      inject: { insertAt: "top" },
    }),
    typescript({
      tsconfig: "tsconfig.json",
    }),
  ],
  external: ["react", "react-dom"],
};

export default config;
@caschbre
Copy link

caschbre commented Oct 6, 2021

I started to receive this error message as well. The odd thing is that I have several .svelte files importing css files... but only one is giving me this error so far.

Table.svelte (this works)

<script>
  import './tables.pcss';
</script>

Pager.svelte (this throws the error)

<script>
  import './pagers.pcss';
</script>

In both cases, the (taliwind) css files look like...

@layer components {
  .some-class {}
}

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

No branches or pull requests

2 participants