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

Extension v1.4.3 doesn't work with transpilers or "type: module" in package.json #765

Open
gabrielgortabns opened this issue Nov 1, 2023 · 3 comments
Assignees
Labels
bug Something isn't working tracked Already in Backlog

Comments

@gabrielgortabns
Copy link

Select the SuiteCloud tool where you encountered the issue

SuiteCloud Extension for VSCode

Version of the SuiteCloud Tool

1.4.3

Operating system

Windows 11

Node Version / VSCode Version

Node: v18.15.0, VSCode: v1.83.1

JAVA Version

java 17.0.7+8-LTS-224

Bug description

We use ESM template, that has "type": "module" in package.json, ./src folder holds ESM version of code, that is transpiled with babel to ./build folder.

In suitecloud.config.js I have set defaultProjectFolder: 'build', it worked fine until 1.4.2 version of extension, but after 1.4.3, there is issue and it's impossible to execute commands. It throws just pointless error "Something went wrong".

Steps To Reproduce

  1. create template
  2. rename ./src folder to ./build
  3. set defaultProjectFolder: 'build' in suitecloud.config.js
  4. create new ./src with same structure as ./build but containing ESM files

Actual Output

No response

Expected Output

No response

Anything else?

Until 1.4.2 version, everything worked fine.

@antoniofruci antoniofruci self-assigned this Nov 2, 2023
@antoniofruci
Copy link
Member

antoniofruci commented Nov 6, 2023

Hello @GabrielGorta, unfortunately at the moment it's not possible to have a suitecloud.config.js file using ESM. You can see more details by using the command line instead of the extension. We will work on providing the same information within VSCode.
Meanwhile, is setting the package.json type to commonjs an option for you?

@gabrielgortabns
Copy link
Author

gabrielgortabns commented Nov 6, 2023

Hello, in 1.4.2 it worked with ESM fine. Content of suitecloud.config.js is:

module.exports = {
	defaultProjectFolder: 'build',
	commands: {}
};

(same as default, except it points to build folder)

But as I wrote, in package.json we have set type: module. I tried to change the file name to suitecould.config.cjs but it also doesn't work. Sadly, settings type: commonjs is not option for us, as source files are in ESM format and transpiler expect type to be set to module.

@antoniofruci antoniofruci added tracked Already in Backlog bug Something isn't working labels Nov 24, 2023
@lfpvillegas
Copy link
Member

Related to #487

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tracked Already in Backlog
Projects
None yet
Development

No branches or pull requests

3 participants