notion-sdk-js icon indicating copy to clipboard operation
notion-sdk-js copied to clipboard

Simply importing notion into an Astro project doesn't work

Open tadaspetra opened this issue 1 year ago • 1 comments

Describe the bug Adding this script tag to an Astro project, causes it to not run the script at all.

<script>
  import { Client } from "@notionhq/client";
  console.log("notion")
  const notion = new Client({ auth: "<secret>"});
</script>

And shows this error on the client

Uncaught SyntaxError: The requested module '/node_modules/@notionhq/client/node_modules/whatwg-url/lib/public-api.js?v=0c9a2969' does not provide an export named 'default' (at index.mjs?v=0c9a2969:4:8)

To Reproduce Node version: v16.14.2 Notion JS library version: ^2.2.11

Steps to reproduce the behavior: Import Client from library

tadaspetra avatar Aug 25 '23 10:08 tadaspetra

It happens also when importing the library on a react component in Astro.

a-barbieri avatar Mar 13 '24 15:03 a-barbieri