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

fix(kit): add legacy entrypoints for pre v3.3 usage #19874

Merged
merged 3 commits into from Mar 24, 2023
Merged

Conversation

danielroe
Copy link
Member

πŸ”— Linked issue

#19717

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

In various cases users on projects pre-3.3 who are consuming a 3.3 kit may receive an error message (because previously we were using cjs resolve utilities to resolve kit.

For example: nuxt/nuxt.new#55.

This adds backward compatibility for those previous projects.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@codesandbox
Copy link

codesandbox bot commented Mar 23, 2023

CodeSandbox logoCodeSandbox logoΒ  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

packages/kit/package.json Outdated Show resolved Hide resolved
@danielroe danielroe mentioned this pull request Mar 23, 2023
@@ -8,7 +8,8 @@
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs"
"import": "./dist/index.mjs",
"require": "./dist/index.mjs"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unsafe especially that i constantly see modules wrongly build with .cjs in dist and actually do require('@nuxt/kit') but seems we don't have any choice at least until patched versions of nuxt 3 are widely adapted...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, this is terrible, I agree. But I think require shouldn't work in any case, as we have type: "module"

@danielroe danielroe merged commit a0c2fb3 into main Mar 24, 2023
10 checks passed
@danielroe danielroe deleted the fix/legacy-kit branch March 24, 2023 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants