jhipster / jhipster-lite

JHipster Lite ⚡ is a development platform to generate, develop & deploy modern web applications & microservices architecture, step by step - using Hexagonal Architecture :gem:
https://lite.jhipster.tech
Apache License 2.0
463 stars 212 forks source link

Fail to apply typescript and vue-core in a second time #11106

Closed DamnClin closed 2 days ago

DamnClin commented 1 week ago

Step to reproduce:

  1. Create an app with typescript module;
  2. Launch npm install
  3. Add vue-core module.

Error:

2024-10-12T16:02:20.575+02:00  INFO 97582 --- [jhlite] [omcat-handler-0] t.j.l.m.domain.JHipsterModulesApplyer    : Apply module: vue-core
[STARTED] Preparing lint-staged...
[COMPLETED] Preparing lint-staged...
[STARTED] Running tasks for staged files...
[STARTED] .lintstagedrc.cjs — 25 files
[STARTED] {src/**/,}*.{ts,vue} — 14 files
[STARTED] *.{md,json,yml,html,css,scss,java,xml,feature} — 7 files
[STARTED] eslint --fix
[STARTED] prettier --write
[FAILED] eslint --fix [FAILED]
[FAILED] eslint --fix [FAILED]
[COMPLETED] Running tasks for staged files...
[STARTED] Applying modifications from tasks...
[SKIPPED] Skipped because of errors from tasks.
[STARTED] Reverting to original state because of errors...
[FAILED] prettier --write [KILLED]
[FAILED] prettier --write [KILLED]
[COMPLETED] Reverting to original state because of errors...
[STARTED] Cleaning up temporary files...
[COMPLETED] Cleaning up temporary files...

✖ eslint --fix:

Oops! Something went wrong! :(

ESLint: 9.12.0

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'eslint-plugin-vue' imported from /tmp/227a3783-d0a9-4f9a-b13a-3db63561a8bc/eslint.config.js
    at packageResolve (node:internal/modules/esm/resolve:854:9)
    at moduleResolve (node:internal/modules/esm/resolve:927:18)
    at defaultResolve (node:internal/modules/esm/resolve:1169:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:540:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:509:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:239:38)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:96:40)
    at link (node:internal/modules/esm/module_job:95:36)

✖ prettier --write failed without output (KILLED).
husky - pre-commit script failed (code 1)
2024-10-12T16:02:21.112+02:00 ERROR 97582 --- [jhlite] [omcat-handler-0] t.j.l.s.e.i.p.GeneratorErrorsHandler     : Can't commit :Rejected by "pre-commit" hook.
[FAILED] eslint --fix [FAILED]
[FAILED] eslint --fix [FAILED]
[FAILED] prettier --write [KILLED]
[FAILED] prettier --write [KILLED]

✖ eslint --fix:

Oops! Something went wrong! :(

ESLint: 9.12.0

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'eslint-plugin-vue' imported from /tmp/227a3783-d0a9-4f9a-b13a-3db63561a8bc/eslint.config.js
    at packageResolve (node:internal/modules/esm/resolve:854:9)
    at moduleResolve (node:internal/modules/esm/resolve:927:18)
    at defaultResolve (node:internal/modules/esm/resolve:1169:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:540:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:509:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:239:38)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:96:40)
    at link (node:internal/modules/esm/module_job:95:36)

✖ prettier --write failed without output (KILLED).

tech.jhipster.lite.module.infrastructure.secondary.git.GitCommitException: Can't commit :Rejected by "pre-commit" hook.
[FAILED] eslint --fix [FAILED]
[FAILED] eslint --fix [FAILED]
[FAILED] prettier --write [KILLED]
[FAILED] prettier --write [KILLED]

✖ eslint --fix:

Oops! Something went wrong! :(

ESLint: 9.12.0

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'eslint-plugin-vue' imported from /tmp/227a3783-d0a9-4f9a-b13a-3db63561a8bc/eslint.config.js
    at packageResolve (node:internal/modules/esm/resolve:854:9)
    at moduleResolve (node:internal/modules/esm/resolve:927:18)
    at defaultResolve (node:internal/modules/esm/resolve:1169:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:540:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:509:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:239:38)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:96:40)
    at link (node:internal/modules/esm/module_job:95:36)

✖ prettier --write failed without output (KILLED).

    at tech.jhipster.lite.module.infrastructure.secondary.git.JGitGitRepository.commitAll(JGitGitRepository.java:64)
    at tech.jhipster.lite.module.domain.git.GitRepository.commitAll(GitRepository.java:11)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    at java.base/java.lang.reflect.Method.invoke(Method.java:580)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:355)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:768)
    at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:138)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:768)
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:720)
    at tech.jhipster.lite.module.infrastructure.secondary.git.JGitGitRepository$$SpringCGLIB$$0.commitAll(<generated>)
    at tech.jhipster.lite.module.domain.JHipsterModulesApplyer.commitIfNeeded(JHipsterModulesApplyer.java:172)
    at tech.jhipster.lite.module.domain.JHipsterModulesApplyer.apply(JHipsterModulesApplyer.java:116)
    at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
    at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
    at java.base/java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:722)
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
    at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
    at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
    at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
    at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
    at tech.jhipster.lite.module.domain.JHipsterModulesApplyer.apply(JHipsterModulesApplyer.java:64)
    at tech.jhipster.lite.module.application.JHipsterModulesApplicationService.apply(JHipsterModulesApplicationService.java:40)
    at tech.jhipster.lite.module.infrastructure.primary.ModulesResource.applyPatches(ModulesResource.java:51)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    at java.base/java.lang.reflect.Method.invoke(Method.java:580)
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:255)
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:188)
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:118)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:926)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:831)
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1089)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:979)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014)
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:914)
    at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:590)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885)
    at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:195)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
    at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:91)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
    at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
    at org.springframework.web.filter.ServerHttpObservationFilter.doFilterInternal(ServerHttpObservationFilter.java:113)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:483)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:384)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:905)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1741)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
    at java.base/java.lang.VirtualThread.run(VirtualThread.java:311)
Caused by: org.eclipse.jgit.api.errors.AbortedByHookException: Rejected by "pre-commit" hook.
[FAILED] eslint --fix [FAILED]
[FAILED] eslint --fix [FAILED]
[FAILED] prettier --write [KILLED]
[FAILED] prettier --write [KILLED]

✖ eslint --fix:

Oops! Something went wrong! :(

ESLint: 9.12.0

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'eslint-plugin-vue' imported from /tmp/227a3783-d0a9-4f9a-b13a-3db63561a8bc/eslint.config.js
    at packageResolve (node:internal/modules/esm/resolve:854:9)
    at moduleResolve (node:internal/modules/esm/resolve:927:18)
    at defaultResolve (node:internal/modules/esm/resolve:1169:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:540:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:509:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:239:38)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:96:40)
    at link (node:internal/modules/esm/module_job:95:36)

✖ prettier --write failed without output (KILLED).

    at org.eclipse.jgit.hooks.GitHook.handleError(GitHook.java:195)
    at org.eclipse.jgit.hooks.GitHook.doRun(GitHook.java:173)
    at org.eclipse.jgit.hooks.PreCommitHook.call(PreCommitHook.java:65)
    at org.eclipse.jgit.api.CommitCommand.call(CommitCommand.java:184)
    at tech.jhipster.lite.module.infrastructure.secondary.git.JGitGitRepository.commitAll(JGitGitRepository.java:62)
    ... 80 common frames omitted

2024-10-12T16:02:21.126+02:00  WARN 97582 --- [jhlite] [omcat-handler-0] .m.m.a.ExceptionHandlerExceptionResolver : Resolved [tech.jhipster.lite.module.infrastructure.secondary.git.GitCommitException: Can't commit :Rejected by "pre-commit" hook.<EOL>[FAILED] eslint --fix [FAILED]<EOL>[FAILED] eslint --fix [FAILED]<EOL>[FAILED] prettier --write [KILLED]<EOL>[FAILED] prettier --write [KILLED]<EOL><EOL>✖ eslint --fix:<EOL><EOL>Oops! Something went wrong! :(<EOL><EOL>ESLint: 9.12.0<EOL><EOL>Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'eslint-plugin-vue' imported from /tmp/227a3783-d0a9-4f9a-b13a-3db63561a8bc/eslint.config.js<EOL>    at packageResolve (node:internal/modules/esm/resolve:854:9)<EOL>    at moduleResolve (node:internal/modules/esm/resolve:927:18)<EOL>    at defaultResolve (node:internal/modules/esm/resolve:1169:11)<EOL>    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:540:12)<EOL>    at ModuleLoader.resolve (node:internal/modules/esm/loader:509:25)<EOL>    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:239:38)<EOL>    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:96:40)<EOL>    at link (node:internal/modules/esm/module_job:95:36)<EOL><EOL>✖ prettier --write failed without output (KILLED).<EOL>]
qmonmert commented 1 week ago

@DamnClin it seems related to #7225 you have this error because you did npm install in your app (with Prettier) before adding vue-core (without npm install it seems working)

DamnClin commented 1 week ago

@DamnClin it seems related to #7225 you have this error because you did npm install in your app (with Prettier) before adding vue-core (without npm install it seems working)

Yes, forgot to add in in steps :)

pascalgrimaud commented 1 week ago

I'm adding a small bounty as it's important to have a quick fix on this

DamnClin commented 1 week ago

I'm adding a small bounty as it's important to have a quick fix on this

I think this can be really hard to get a proper fix on that :D

pascalgrimaud commented 1 week ago

I didn't have a look on the root cause, but I will increase the bounty, depending on the amount of work to fix this.

We should be able to reapply each modules, with/without npm install

pascalgrimaud commented 2 days ago

Increasing the bounty as it was more work than expected