master-co / css

The CSS Language and Framework

Home Page:https://css.master.co

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🐞 Export error with sveltekit

ryoppippi opened this issue Β· comments

Description

When I build a project, I got the error like this

import { render } from '@master/css/render';
         ^^^^^^^^^^
SyntaxError: Named export 'render' not found. The requested module '@master/css/render' is a CommonJS module, which ma
y not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@master/css/render';
const { render } = pkg;
import { StyleSheet } from "@master/css";
         ^^^^^^^^^
SyntaxError: Named export 'StyleSheet' not found. The requested module '@master/css' is a CommonJS module, which may
 not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@master/css';
const { StyleSheet } = pkg;

I think this related to ESM building?

Reproduction

  1. Go to Svelte Lab project https://www.sveltelab.dev/bocwo4ayxdt0c69
  2. Ctrl-C at the terminal
  3. npm run build

I also got this error in my local machine

System Informations

No response

commented

@ryoppippi It's recommended to check out the v2 documentation at https://beta.css.master.co/docs/installation/svelte