Fix determining TSR version when running in certain configurations#1537
Closed
rjmunro wants to merge 1 commit intoSofie-Automation:mainfrom
Closed
Fix determining TSR version when running in certain configurations#1537rjmunro wants to merge 1 commit intoSofie-Automation:mainfrom
rjmunro wants to merge 1 commit intoSofie-Automation:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Member
|
I'm wondering where/how this is an issue, as these libs officially only suport node22+ in release52+. sofie-core/packages/shared-lib/package.json Lines 31 to 33 in 9bd232e The build config might be doing so with support for older, but that will be changed whenever someone feels like it (it often lags a bit behind) The latest r53 build of this file (from https://www.npmjs.com/package/@sofie-automation/shared-lib/v/1.53.0-nightly-release53-20250924-143640-007a9da.0?activeTab=code) is: so I am curious what this PR will actually change |
Without breaking node 16
This prevents the error:
TypeError [ERR_IMPORT_ATTRIBUTE_MISSING]: Module "file:///Users/rjmunro/superflytv/sofie-timeline-state-resolver/packages/timeline-state-resolver-types/package.json" needs an import attribute of "type: json"
at validateAttributes (node:internal/modules/esm/assert:88:15)
at defaultLoadSync (node:internal/modules/esm/load:179:3)
at ModuleLoader.getModuleJobForRequire (node:internal/modules/esm/loader:379:24)
at new ModuleJobSync (node:internal/modules/esm/module_job:341:34)
at ModuleLoader.importSyncForRequire (node:internal/modules/esm/loader:326:11)
at loadESMFromCJS (node:internal/modules/cjs/loader:1411:24)
at Module._compile (node:internal/modules/cjs/loader:1544:5)
at Object..js (node:internal/modules/cjs/loader:1699:10)
at Module.load (node:internal/modules/cjs/loader:1313:32)
at Function._load (node:internal/modules/cjs/loader:1123:12) {
code: 'ERR_IMPORT_ATTRIBUTE_MISSING'
Which I got when trying to build blueprints using node 20 when I was
yarn link`ed to sofie-core, rather than using a pre-built version.
db4bb4c to
7154a3f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
About the Contributor
Type of Contribution
This is a Bug fix / Code improvement for compatibility with later node versions
Current Behavior
Using
importwith a json file is banned in node 20 unless you usewith { type: 'json' }, which is not supported in node 16, our current build target.Question: Does using import freeze the value at sofie-core build time, not reflect the version that yarn has chosen to install? If so, is that the right thing to do?
New Behavior
Use require to import the
package.jsonfile.Testing
Affected areas
This PR affects building blueprints.
Time Frame
Status