Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update node version to 18.X to fix ky universal build issues #573

Conversation

onnimonni
Copy link
Contributor

Context

This PR builds on top of #568. That PR should be merged first so that we get smaller overall changes.

Root cause

After @transitive-bullshit replaced got for ky #394 our builds broke down with following issue:

Error: R] Could not resolve "ky-universal"

    src/notion-api-universal.ts:2:7:
      2 │ import 'ky-universal'
        ╵        ~~~~~~~~~~~~~~

  You can mark the path "ky-universal" as external to exclude it from the bundle, which will remove this error.

I noticed that the ky-universal is not needed anymore if we update ky to 1.0.0 and nodejs to version 18.X version.

Consequences and why we need to add tsimp

After I upgraded them our tests started to fail in all packages:

lerna ERR! yarn run test exited 1 in 'notion-compat'
lerna ERR! yarn run test stdout:
$ ava

  Uncaught exception in src/notion-compat-api.test.ts

  TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /Users/onnimonni/Projects/react-notion-x/packages/notion-compat/src/notion-compat-api.test.ts

  ✖ src/notion-compat-api.test.ts exited with a non-zero exit code: 1
  ─

  1 uncaught exception
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
lerna ERR! yarn run test stderr:
error Command failed with exit code 1.
lerna ERR! yarn run test exited 1 in 'notion-compat'

I wasn't able to figure out this on my own but I was using the cursor editor and it suggested adding tsimp as loader for ava and then the tests started to work.

We can't use the latest version of tsimp so it's pinned to 2.0.11.
It can be updated when we get node 18 support.

…ed-tool-versions

* upstream/master:
  Add missing new attribute 'card_cover_position' to BasePageBlock to fix ts build error
* document-the-needed-tool-versions:
  Downgrade node version to 16.X and start using .tool-versions so that we can use same version in GH runner
  Document how to get the project up and running with correct dependencies using mise
After replacing got package with ky the builds started to fail. This fixes NotionX#572
Copy link

vercel bot commented Oct 31, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
react-notion-x ✅ Ready (Inspect) Visit Preview Oct 31, 2024 11:16am
react-notion-x-minimal-demo ✅ Ready (Inspect) Visit Preview Oct 31, 2024 11:16am

@transitive-bullshit
Copy link
Member

Fixed in #571

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants