Skip to content

@akin01/solid-email import fails in Vite dev: ssrStyleProperty missing from solid-js/web dev build #6

Description

@Akin01

Summary

Importing @akin01/solid-email@0.1.3 in a Vite/Solid dev server can fail during dependency optimization because the package imports ssrStyleProperty from solid-js/web.

ssrStyleProperty exists in Solid's server build, but not in the dev/browser build that Vite may resolve during dependency optimization.

Reproduction

Using these versions:

  • @akin01/solid-email@0.1.3
  • @solid-email/render@0.1.3
  • solid-js@1.9.13
  • vite@8.0.16
  • vite-plugin-solid@2.11.12
  • Node v24.18.0

In a Vite app configured with Solid SSR, import the component package from a module reachable by Vite dev optimization:

import { Body, Button, Html, Text } from "@akin01/solid-email";

Run:

vite dev

Actual result

Vite dev starts optimizing dependencies, then fails:

Error during dependency optimization:

Build failed with 1 error:

[MISSING_EXPORT] "ssrStyleProperty" is not exported by "../../node_modules/.pnpm/solid-js@1.9.13/node_modules/solid-js/web/dist/dev.js".

../../node_modules/.pnpm/@akin01+solid-email@0.1.3_solid-js@1.9.13/node_modules/@akin01/solid-email/dist/index.mjs:2:83
2 │ import { Dynamic, createComponent, escape, mergeProps, ssr, ssrElement, ssrStyle, ssrStyleProperty } from "solid-js/web";
  │                                                                                   ~~~~~~~~~~~~~~~~

Expected result

The package should work in Vite dev/SSR dependency optimization, or avoid importing server-only Solid internals through the generic solid-js/web entrypoint.

Evidence

@akin01/solid-email/dist/index.mjs imports:

import { ..., ssrStyleProperty } from "solid-js/web";

In solid-js@1.9.13:

  • solid-js/web/dist/server.js exports ssrStyleProperty
  • solid-js/web/dist/dev.js does not export ssrStyleProperty

Workaround used downstream

I avoided importing @akin01/solid-email from code reachable by browser/dev optimization and loaded the email template module lazily on the server.

That avoids the dev crash, but the package itself still appears fragile because it depends on conditional resolution selecting the server build.

Possible fix

One of:

  • avoid using ssrStyleProperty,
  • import it from a server-specific Solid entry if that is supported/public,
  • add package/export conditions so SSR/email rendering resolves only against server-compatible Solid builds,
  • or pin/document compatible Solid/Vite resolution constraints.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions