prismicio / prismic-client

The official JavaScript + TypeScript client library for Prismic
https://prismic.io/docs/technical-reference/prismicio-client
Apache License 2.0
168 stars 60 forks source link

Missing exports in requested module (skypack @prismicio/client) #272

Closed DeiveLab closed 1 year ago

DeiveLab commented 1 year ago

Versions

Steps to reproduce

  1. Follow the instructions for prismic setup on browser
  2. After adding the script line import * as prismic from 'https://cdn.skypack.dev/@prismicio/client', open the browser
  3. The error Uncaught SyntaxError: The requested module '/-/@prismicio/richtext@v2.1.2-xpg8EyWwrWOVukye9GlX/dist=es2019,mode=imports/optimized/@prismicio/richtext.js' does not provide an export named 'Element' (at asHTML-c72c6cce.js:1:48) should appear on the browser console.

What is expected?

The import should complete gracefully and provide access to the prismic tools, allowing the client to fetch the page content

What is actually happening?

Error on base skypack @prismic/client module import, breaking page functionality prismic-import-error

github-actions[bot] commented 1 year ago

You created this issue using the 🚨 Bug report template therefore it has been flagged as such.

Hi there, thank you so much for your contribution!

Following our Maintenance process, we will review your bug report and get back to you next Wednesday. To ensure a smooth review of your issue and avoid unnecessary delays, please make sure your issue include the following:

If you have identified the cause of the bug described in your report and know how to fix it, you're more than welcome to open a pull request addressing it. Check out our quick start guide for a simple contribution process.

If you think your issue is a question (not a bug) and would like quicker support, please close this issue and forward it to an appropriate section on our community forum: https://community.prismic.io

- Prismic Open-Source team

lihbr commented 1 year ago

Hey there,

Thank you so much for creating an issue and sorry for the inconvenience.

I just released some updates fixing the dependency for Skypack. Once Skypack cache has updated, it should work fine again (I just tested now, it seems already done), in the meantime, if you still have issues, it should work with those scripts instead:

import * as prismic from 'https://cdn.skypack.dev/@prismicio/client@6.7.3'
import * as prismicH from 'https://cdn.skypack.dev/@prismicio/helpers@2.3.8'

Let us know if anything!