solidjs / solid-styled-components

A 1kb Styled Components library for Solid

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Running on Vite: SyntaxError: Named export 'css' not found.

btakita opened this issue · comments

SyntaxError: Named export 'css' not found. The requested module 'goober' 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 'goober';
const { css, setup: gooberSetup } = pkg;

    at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)

Interestingly enough goober also exports ESM, so I can only figure it's the resolution order. Looking at goober the order is pretty chaotic between different sub-module exports. And the main export seems to prioritize CJS which is weird. Hmm.. this might be something we have to address downstream with them.

Thank you.

I was able to get it working by adding solid-styled-components as a git submodule in a monorepo.

Goober exports ESM, but with .js as the extension and without "type": "module".

Just an issue of not following the Node spec.