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

Undo ajv8 alias and fix Vite dev server #3371

Merged
merged 4 commits into from Jan 14, 2023

Conversation

nickgros
Copy link
Contributor

@nickgros nickgros commented Jan 13, 2023

  • Upgrade vite to 4.0.4
  • Remove ajv8 alias for validator-ajv8 (will fix issues in skypack)
  • Set preserveSymlinks to true in vite.config.js (fixes issue in Vite dev server where @rjsf/validator-ajv8 incorrectly uses ajv@6)

Reasons for making this change

Fixes #3215

We have an issue where the Vite development server is accessing files from ajv v6 when it should be using ajv v8. It's unclear if this is a Vite/esbuild bug, or some configuration error.

We originally fixed this in #3229, but this solution has caused other downstream issues (e.g. Skypack, which is used in CodePen examples, cannot handle npm aliases).

Setting the Vite config preserveSymlinks parameter to true seems to fix this issue.

Checklist

  • I'm updating documentation
  • I'm adding or updating code
    • I've added and/or updated tests. I've run npm run test:update to update snapshots, if needed.
    • I've updated docs if needed
    • I've updated the changelog with a description of the PR
  • I'm adding a new feature
    • I've updated the playground with an example use of the feature

@nickgros nickgros mentioned this pull request Jan 13, 2023
@heath-freenome
Copy link
Member

Let's merge #3372 first then rebase this one. Hopefully the package-lock.json changes go away. Either way let's not merge any of the lock file changes except for what is in the packages with package.json changes

- Upgrade vite to 4.0.4
- Remove ajv8 alias for validator-ajv8 (will fix issues in skypack)
- Change vite mode to production (fixes issue where vite/esbuild mix up ajv v6 and v8)
CHANGELOG.md Outdated Show resolved Hide resolved
@heath-freenome heath-freenome merged commit b242804 into rjsf-team:main Jan 14, 2023
shijistar pushed a commit to shijistar/react-jsonschema-form that referenced this pull request Jun 8, 2023
* Re-fix rjsf-team#3228 and related follow-up issues
- Upgrade vite to 4.0.4
- Remove ajv8 alias for validator-ajv8 (will fix issues in skypack)
- Change vite mode to production (fixes issue where vite/esbuild mix up ajv v6 and v8)

* Update lockfile

* `preserveSymlinks` seems to fix rather than changing `mode`

* Update CHANGELOG
shijistar pushed a commit to shijistar/react-jsonschema-form that referenced this pull request Jun 8, 2023
* Re-fix rjsf-team#3228 and related follow-up issues
- Upgrade vite to 4.0.4
- Remove ajv8 alias for validator-ajv8 (will fix issues in skypack)
- Change vite mode to production (fixes issue where vite/esbuild mix up ajv v6 and v8)

* Update lockfile

* `preserveSymlinks` seems to fix rather than changing `mode`

* Update CHANGELOG
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.

codepen examples in docs broken
2 participants