You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a project that was initially built in pure JavaScript. With the release of the typescript support, we ported the business logic of our project to typescript.
Most, if not all, of the UI logic is still in JavaScript.
Since the latest release of the lighting-CLI (2.12.0) this project gives us issues when compiling. Below the output of the attached minimal example project.
[!] Error: 'brokenEnum' is not exported by src/enum.ts, imported by src/App.js
https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module
src/App.js (2:9)
1: import { Lightning, Utils } from "@lightningjs/sdk";
2: import { brokenEnum } from "./enum";
^
3:
4: export default class App extends Lightning.Component {
The error seems specifically related to importing const enums in .js files from .ts files. When we remove const the project compiles.
When we build the same project with the previous version of lightning-cli (2.11.0) there also is no issue.
While asking on the community discord we found following additional result:
I noticed this line in the commit. fs.existsSync(path.join(process.cwd(), 'tsconfig.json')) && typescript(),
I deleted our tsconfig.json file and now it seems to compile correctly. So it gives the error mentioned when using the default tsconfig that is generated when using lng create.
But it compiles fine when we have no tsconfig and it falls back to (if i understand correctly) the default rollup config
Is it recommended to have no tsconfig.json?
Seems strange that lng create would add one in that case.
The text was updated successfully, but these errors were encountered:
@Sv-Th What does your project's tsconfig.json look like? TypeScript has a compiler option called isolatedModules. When enabled you are not allowed to use const enum references in your project. It is not enabled by default which might explain why your project compiles without the tsconfig.json present.
We have a project that was initially built in pure JavaScript. With the release of the typescript support, we ported the business logic of our project to typescript.
Most, if not all, of the UI logic is still in JavaScript.
Since the latest release of the lighting-CLI (2.12.0) this project gives us issues when compiling. Below the output of the attached minimal example project.
The error seems specifically related to importing const enums in .js files from .ts files. When we remove const the project compiles.
When we build the same project with the previous version of lightning-cli (2.11.0) there also is no issue.
com.domain.app.brokenEnum.zip
While asking on the community discord we found following additional result:
I noticed this line in the commit.
fs.existsSync(path.join(process.cwd(), 'tsconfig.json')) && typescript(),
I deleted our tsconfig.json file and now it seems to compile correctly. So it gives the error mentioned when using the default tsconfig that is generated when using lng create.
But it compiles fine when we have no tsconfig and it falls back to (if i understand correctly) the default rollup config
Is it recommended to have no tsconfig.json?
Seems strange that lng create would add one in that case.
The text was updated successfully, but these errors were encountered: