Expand my Community achievements bar.

SOLVED

Maven build error with archtype 32

Avatar

Level 7

Hi All,

 

I recently start a project with archetype 32. After creating it, I tried to build it using maven as:

 

mvn clean install, I got following error:

 

[INFO] WARNING in ./src/main/webpack/site/main.ts

[INFO] Module Warning (from ./node_modules/glob-import-loader/index.js):

[INFO] (Emitted value instead of an instance of Error) Empty results for "import "./**/*.ts""

[INFO] NonErrorEmittedError: (Emitted value instead of an instance of Error) Empty results for "import "./**/*.ts""

[INFO]     at Object.emitWarning (/Users/kev/workspace/aem/mysite-aem/ui.frontend/node_modules/webpack/lib/NormalModule.js:160:16)

[INFO]     at replaceAsync (/Users/kev/workspace/aem/mysite-aem/ui.frontend/node_modules/glob-import-loader/index.js:119:16)

[INFO]     at process._tickCallback (internal/process/next_tick.js:68:7)

[INFO

[INFO] ERROR in /Users/kev/workspace/aem/mysite-aem/ui.frontend/node_modules/@types/node/ts4.8/util.d.ts

[INFO] [tsl] ERROR in /Users/kev/workspace/aem/mysite-aem/ui.frontend/node_modules/@types/node/ts4.8/util.d.ts(1485,42)

[INFO]       TS1005: ',' expected.

[INFO

[INFO] ERROR in /Users/kev/workspace/aem/mysite-aem/ui.frontend/node_modules/@types/node/ts4.8/util.d.ts

[INFO] [tsl] ERROR in /Users/kev/workspace/aem/mysite-aem/ui.frontend/node_modules/@types/node/ts4.8/util.d.ts(1485,44)

[INFO]       TS1068: Unexpected token. A constructor, method, accessor, or property was expected.

...

It fails on ui.frontend module

 

I tried to install TypeScript 4.8 on my Mac, then ran tsc

tsc -version

Version 4.8.4

I tried to find what exactly shows in the first Error report from the file like this one "...@types/node/ts4.8/util.d.ts(1485,42)"

 

The content is:

export class MIMEParams {

       /**

        * Remove all name-value pairs whose name is `name`.

        */

       delete(name: string void;

       /**

        * Returns an iterator over each of the name-value pairs in the parameters.

        */

       entries(): IterableIterator<[name: string, value: string]>;

It's from the line "entries(): .....". 

 

Another project with archetype 22 is fine.

 

Any help will be appreciated!

 

-kt

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi @kevingtan ,

 

Did you try to change the typescript version in package.json (ui.frontend module)? You could also try transpileOnly: true.

 

Also, check this thread

https://github.com/adobe/aem-project-archetype/issues/986 

 

Hope that helps!

 

Regards,

Nitesh

View solution in original post

6 Replies

Avatar

Correct answer by
Employee Advisor

Hi @kevingtan ,

 

Did you try to change the typescript version in package.json (ui.frontend module)? You could also try transpileOnly: true.

 

Also, check this thread

https://github.com/adobe/aem-project-archetype/issues/986 

 

Hope that helps!

 

Regards,

Nitesh

Avatar

Level 7

Hi @nitesh_kumar ,

 

Thanks for your suggestion. I tried all the options you provided, none was working.

I tried 

{
loader: 'ts-loader',
transpileOnly: true
}
in webpack.common.js
 

"typescript": "^4.8.2" and "typescript": "^4.8.4" in ui.frontend/package.json

 

They all failed at "npm install prod", which is an execution id in pom.xml under ui.frontend. Also, transpileOnly is not recognized. I am not sure if my syntax is correct or not, as shown above.

 

-kt

Avatar

Level 7

Hi @nitesh_kumar ,

transpileOnly is working as:

          {
            loader: 'ts-loader',
            options: {
              transpileOnly: true
            }
          }

 Thanks for your help!

Avatar

Employee Advisor

I just see that the version 40 of the archetype has been released, why do you try with that an old version?

Avatar

Level 7

We are using v-22. I am just trying to increment it to see how the new versions are different from the current one and may decide to finalize it later. I am also concerned that if the issues in the lower version, say 32, will be carried in the higher versions. Therefore, I like to know the solution first before I move on in case I will have to resolve the same issue.

 

-kt

Avatar

Employee Advisor

On the other hand side, the latest version might have fixed that problem.