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

Can't import icons using solidjs start #17

Open
joshpetit opened this issue Nov 14, 2022 · 4 comments
Open

Can't import icons using solidjs start #17

joshpetit opened this issue Nov 14, 2022 · 4 comments

Comments

@joshpetit
Copy link

Hey! I'm having trouble importing the icons in my solidjs projects.

Steps to reproduce:

yarn create solid # then y to everything
yarn add @steeze-ui/heroicons
yarn add -D @steeze-ui/solid-icon

Then import the icons as such in index.tsx

import { Icon } from "@steeze-ui/solid-icon";
import { Eye } from "@steeze-ui/heroicons";

import { Title } from "solid-start";
import Counter from "~/components/Counter";

export default function Home() {
  return (
    <main>
      <Title>Hello World</Title>
      <h1 class="text-3xl font-bold underline">Hello world!</h1>
      <Counter />
      <p>
        Visit{" "}
        <a href="https://start.solidjs.com" target="_blank">
          start.solidjs.com
        </a>{" "}
        to learn how to build SolidStart apps.
      </p>
      <Icon src={Eye} theme="solid" class="color-gray-900" />
    </main>
  );
}

And I receive this error when running yarn dev:

@steeze-ui/solid-icon doesn't appear to be written in CJS, but also doesn't appear to be a valid ES module (i.e. it doesn't have "type": "module" or an .mjs extension for the entry point). Please contact the package author to fix.
(node:2004606) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.

I'd appreciate some help getting it to work though, thank you!

@JustinVoitel
Copy link
Contributor

Hey thanks for the report! It should be fixed with @steeze-ui/[email protected] .

@joshpetit
Copy link
Author

Great thanks! One thing that popped up now is:

Could not find a declaration file for module '@steeze-ui/solid-icon'.

@JustinVoitel JustinVoitel reopened this Nov 15, 2022
@JustinVoitel
Copy link
Contributor

Unfortunately I cant reproduce this issue :/ Maybe cleaning your node_modules folder helps ?

@joshpetit
Copy link
Author

Oh interesting, I tried going through the set up process I described earlier again and I still have the error. What version of node are you using? I'm using 19, and tried using 16 with nvm but that didn't seem to do anything.

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