Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

316
Visualizações
Script Loader - Web pack alternatives to Resolve Server Side Rendering build issue (Angular 6)

I'm using using a 3rd party Content management SDK ("dc-delivery-sdk-js": "^0.11.0") which throws error as you may need appropriate loader when trying to run " npm run build:ssr " (Server Dide Rendering build during local development)

ERROR in ./node_modules/dc-delivery-sdk-js/build/module/lib/client/createContentClientV2Fresh.js 3:37
Module parse failed: Unexpected token (3:37)
You may need an appropriate loader to handle this file type.
| import axiosRetry from 'axios-retry';
| import { createBaseContentClient } from './createBaseContentClient';
> const isThrottled = (error) => error?.response?.status === 429;
| const DEFAULT_RETRY_CONFIG = {
|     retries: 3,
 @ ./node_modules/dc-delivery-sdk-js/build/module/lib/client/createContentClient.js 2:0-74 11:15-41
 @ ./node_modules/dc-delivery-sdk-js/build/module/lib/ContentClient.js
 @ ./node_modules/dc-delivery-sdk-js/build/module/index.js
 @ ./dist/moltonbrown-server/main.js
 @ ./server.ts

ERROR in ./node_modules/dc-delivery-sdk-js/build/module/lib/content/coordinators/FilterByImpl.js 9:42
Module parse failed: Unexpected token (9:42)
You may need an appropriate loader to handle this file type.
|     async fetch(requestConfig) {
|         try {
>             if (!requestConfig.parameters?.locale && this.config?.locale) {
|                 requestConfig.parameters = Object.assign({}, {
|                     ...(requestConfig.parameters || {}),
 @ ./node_modules/dc-delivery-sdk-js/build/module/lib/ContentClient.js 8:0-67 113:19-31
 @ ./node_modules/dc-delivery-sdk-js/build/module/index.js
 @ ./dist/moltonbrown-server/main.js
 @ ./server.ts

I've tried script-loader (https://v4.webpack.js.org/loaders/script-loader/) which resolves the build issue locally but throw error post deployment since its has not suppport for Node.js which actually runs the SSR build in server.

any other alternative webpack loaders or solutions to resolve this issue for Angular 6 project ?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda