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 README.md to add 'declare global' to env.d.ts #662

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

OpenSource03
Copy link

Add declare global to internal-packages/next-dev/README.md so people can better understand what they need to do. Just declaring interface is not sufficient and got me confused as I'm not used to working with env.d.ts files, and I'm sure there are other people who would find themselves confused.

Copy link

changeset-bot bot commented Feb 13, 2024

⚠️ No Changeset found

Latest commit: fd1cb84

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dario-piotrowicz
Copy link
Member

Thank you very much for the PR @OpenSource03 🙂

Declaring the interface in a declaration file in the global scope (as indicated in the readme) should work, you can see it working by creating a new Next.js application using this C3 prerelease (cloudflare/workers-sdk#5009):

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7893611368/npm-package-create-cloudflare-5009 --no-auto-update --framework next

I just tested there and it all looks good to me.

The declare global becomes necessary if your declaration file is in a module scope (e.g. if the file has any imports/exports) then in that case you would need to use declare global

So I think that the current readme is correct... but I guess maybe we could clarify better the above? 🤔

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.

None yet

2 participants