Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Fix: Show compile errors and enforce node.js version to permit optional chaining #1579

Merged
merged 3 commits into from
Aug 12, 2021

Conversation

rpocklin
Copy link
Contributor

Description

Looks like the logging for potential errors got commented out somehow in the v9.0.0 release.

Current (introducing a compile-time error intentionally)

  Design System build failed with errors.

error Command failed with exit code 1.

With Fix

ERROR in ./src/components/OcRecipient/OcRecipient.vue?vue&type=style&index=0&lang=scss& (./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ref--10-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--10-2!./node_modules/sass-loader/dist/cjs.js??ref--10-3!./node_modules/sass-resources-loader/lib/loader.js??ref--10-4!./node_modules/vue-loader/lib??vue-loader-options!./src/components/OcRecipient/OcRecipient.vue?vue&type=style&index=0&lang=scss&)
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: expected ";".
   ╷
13 │     text-indent: -9999px;
...

Also, the build/build-tokens/format.js code uses optional chaining, introduced in Node.js v14.0.0 so I set this in the package.json engines configuration to enforce this version (or greater) of Node.js to be used.

Current (running with Node.js v12.22.1 intentionally)

/home/user/owncloud-design-system/build/build-tokens/format.js:5
  if (dictionary.file.report?.colorContrast) {
                             ^

SyntaxError: Unexpected token '.'
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/user/owncloud-design-system/build/build-tokens/format-writer-json.js:3:22)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)```

With Fix

error owncloud-design-system@9.0.0: The engine "node" is incompatible with this module. Expected version ">= 14.0.0". Got "12.22.1"
error Commands cannot run with an incompatible environment.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@update-docs
Copy link

update-docs bot commented Aug 11, 2021

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@CLAassistant
Copy link

CLAassistant commented Aug 11, 2021

CLA assistant check
All committers have signed the CLA.

@rpocklin rpocklin force-pushed the fix-show-error-failures-cli branch from baaded7 to c499772 Compare August 11, 2021 06:55
@rpocklin rpocklin force-pushed the fix-show-error-failures-cli branch 2 times, most recently from b59f9ee to 656f492 Compare August 11, 2021 13:24
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

81.1% 81.1% Coverage
3.0% 3.0% Duplication

@LukasHirt LukasHirt merged commit ab9f116 into owncloud:master Aug 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants