Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Libraries not working with svelte-preprocess v6 #643

Copy link
Copy link
Closed
@flayks

Description

@flayks
Issue body actions

Describe the bug
After upgrading to svelte-preprocess v6, I get into errors using libraries such as @portabletext/svelte where it just says that PortableText is not defined.

Is it linked to the PortableText lib here or svelte-preprocess? The thing that bugs me is that it works perfectly fine with the v5, without changing any code or other dependencies. Just upgrading to svelte-preprocess v6 breaks it.

Logs

generating static routes 
│ 12:57:47 ▶ src/pages/404.astro
│ 12:57:47   └─ /404.html (+106ms)
│ 12:57:48 ▶ src/pages/index.astro
│ 12:57:48   └─ /index.htmlPortableText is not defined
│   Stack trace:
│     at file:///Users/flayks/sites/portfolio/apps/website/dist/chunks/index_SkFUPnTb.mjs:244:31
│     at file:///Users/flayks/sites/portfolio/apps/website/dist/chunks/index_SkFUPnTb.mjs:338:260
│     at Object.render (file:///Users/flayks/sites/portfolio/apps/website/dist/chunks/Button_C7xTWKNE.mjs:31
│ 2:17)
│     at renderFrameworkComponent (file:///Users/flayks/sites/portfolio/apps/website/dist/chunks/astro/serve
│ r_Bc54YaF1.mjs:1111:66)
│     at async renderComponent (file:///Users/flayks/sites/portfolio/apps/website/dist/chunks/astro/server_B
│ c54YaF1.mjs:1271:10)
│ error: script "build" exited with code 1
│ command finished with error: command (/Users/flayks/sites/portfolio/apps/website) /Users/flayks/.volta/bi
│ n/bun run build exited (1)
└────>
 ERROR  run failed: command  exited (1)
error: script "build" exited with code 1

To Reproduce
A bit trivial to reproduce using this specific example with Sanity and PortableText, but just using 5.1.4 vs 6.0.1 breaks the build.

Expected behavior
It should be normally without error

Information about your project:

  • Arc
  • macOS
  • svelte-preprocess version 6.0.1
  • Astro v4.11
jacwright

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.