Skip to content

fix: restore strict mode in the cjs and iife builds - #3035

Merged
cexbrayat merged 1 commit into
vuejs:mainfrom
ValentinYoushkevich:fix/strict-builds
Nov 17, 2026
Merged

cexbrayat merged 1 commit into
vuejs:mainfrom
ValentinYoushkevich:fix/strict-builds

Conversation

@ValentinYoushkevich

Copy link
Copy Markdown
Contributor

This is a regression in 2.6.0: the cjs and iife builds are no longer in strict mode. Rolldown's output.strict defaults to 'auto' (keep only directives from the sources), while rollup emitted 'use strict' by default, so the switch in #3010 dropped it.

This affects anyone resolving the cjs build, e.g. Jest, or Vitest with its default settings. For example, wrapper.setData({ foo: 'bar' }) on a component without data no longer throws Cannot add property foo, object is not extensible; it silently does nothing. The existing does not set new properties test covers this, but only runs against the sources and the esm-bundler build.

This sets strict: true and adds a test that runs the same check against both builds.

@netlify

netlify Bot commented Nov 15, 2026

Copy link
Copy Markdown

👷 Deploy request for vue-test-utils-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit df38a1e

@pkg-pr-new

pkg-pr-new Bot commented Nov 15, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@vue/test-utils@3035

commit: df38a1e

@cexbrayat
cexbrayat merged commit 489cbad into vuejs:main Nov 17, 2026
6 checks passed
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