x64Bits / solid-icons

The simplest way to use icons in SolidJS
https://solid-icons.vercel.app
MIT License
284 stars 18 forks source link

Build Error with Astro SSR adapters #45

Closed Tanish2002 closed 8 months ago

Tanish2002 commented 1 year ago

I'm trying deploy my project on cloudflare via the astro provided ssr adapter.

Whenever I try to build the project I get this error:

✘ [ERROR] No matching export in "node_modules/.pnpm/solid-js@1.7.7/node_modules/solid-js/web/dist/server.js" for import "memo"

    node_modules/.pnpm/solid-icons@1.0.8_solid-js@1.7.7/node_modules/solid-icons/lib/index.js:1:47:
      1 │ import { mergeProps, spread, insert, isServer, memo, template } from 'solid-js/web';
        ╵                                                ~~~~

✘ [ERROR] No matching export in "node_modules/.pnpm/solid-js@1.7.7/node_modules/solid-js/web/dist/server.js" for import "template"

    node_modules/.pnpm/solid-icons@1.0.8_solid-js@1.7.7/node_modules/solid-icons/lib/index.js:1:53:
      1 │ import { mergeProps, spread, insert, isServer, memo, template } from 'solid-js/web';
        ╵                                                      ~~~~~~~~

 error   No matching export in "node_modules/.pnpm/solid-js@1.7.7/node_modules/solid-js/web/dist/server.js" for import "memo"
  File:
    node_modules/.pnpm/solid-icons@1.0.8_solid-js@1.7.7/node_modules/solid-icons/lib/index.js:1:47
  Code:
    > 1 | import { mergeProps, spread, insert, isServer, memo, template } from 'solid-js/web';
        |                                               ^
      2 | import { splitProps } from 'solid-js';
      4 | const _tmpl$ = /*#__PURE__*/template(`<svg stroke-width="0"></svg>`, 2),

Out of curiosity I tried it with other adapters like vercel and the problem still persists.

It builds fine without any ssr adapters.

Here is a minimal reproduction of problem: https://codesandbox.io/p/sandbox/bold-wilbur-kch7zp You can check it by doing a yarn build

Guergeiro commented 11 months ago

Having the same issue.

x64Bits commented 11 months ago

Hi thanks for report this, I'm sure that this problem is related to exports in package.json generated by the library, I'm imitating the way solidjs did it in its 1.4 version, but I have seen that they added the worker key which I imagine should be used to target the correct import using cloudflare.

Guergeiro commented 11 months ago

@x64Bits I've tried to offload it in Astro using client:only="solid-js" directives and even just re exporting a the Svg as its separate Solid component, to no avail. Do you have a solution on the way for this?

x64Bits commented 9 months ago

Hello, sorry for the delay, I have sent a beta version of the package with a possible correction for this problem, if you can take a look at it for feedback, there is also an open PR in case you have comments #54, greetings and thank you very much. https://www.npmjs.com/package/solid-icons/v/1.1.0-beta.1

silesmo commented 9 months ago

The solid-icons@1.1.0-beta.1 still has the same issues @x64Bits

x64Bits commented 8 months ago

Hi @silesmo, thanks for let me know about it, Version 1.1.0 address this issue, can you take a look it is working properly now?

x64Bits commented 8 months ago

I'll assume this issue was resolved in 1.1.0, regards.