pldn / LDWizard

🧙 LDWizard: A generic framework for simplifying the creation of linked data. Supported by the PLDN community.
European Union Public License 1.2
13 stars 7 forks source link

Issue with deploying a LDWizard from custom config #79

Closed vemonet closed 1 year ago

vemonet commented 1 year ago

Hi @mightymax and the LDWizard team,

I am trying to deploy the LDWizard using this basic config.ts file found in the CONFIGURING.md docs:

import WizardConfig from "@pldn/ldwizard/types/WizardConfig";
const wizardConfig: WizardConfig = {};

window.config = wizardConfig;

And this minimalistic package.json:

{
  "license": "MIT",
  "scripts": {
    "build": "ldwizard-build ./config.ts",
    "dev": "yarn build && cd lib && http-server ."
  },
  "dependencies": {
    "@pldn/ldwizard": "^2.0.0"
  },
  "devDependencies": {
    "http-server": "^14.1.1"
  }
}

And the .yarnrc mentioned in the docs, it can then be used to build the LDWizard with:

yarn
yarn build

But I am getting this error when running locally with node18, and in docker with node16 (sorry the error log is a bit long!):

 > [build 9/9] RUN yarn build:
#0 0.637 yarn run v1.22.19
#0 0.666 $ ldwizard-build ./config.ts
#0 1.570 Config found at /app/config.ts
#0 1.832 Start webpack compilation
#0 1.838 [LD-Wizard] Compiling
#0 45.62 {
#0 45.62   file: '/app/node_modules/@pldn/ldwizard/src/containers/Publish/DownloadResults.tsx',
#0 45.62   moduleIdentifier: '/app/node_modules/babel-loader/lib/index.js??ruleSet[1].rules[0].rules[0]!/app/node_modules/ts-loader/index.js??ruleSet[1].rules[0].rules[1]!/app/node_modules/@pldn/ldwizard/src/containers/Publish/DownloadResults.tsx',
#0 45.62   moduleName: './node_modules/@pldn/ldwizard/src/containers/Publish/DownloadResults.tsx',
#0 45.62   loc: '36:43-49',
#0 45.62   message: '[tsl] ERROR in /app/node_modules/@pldn/ldwizard/src/containers/Publish/DownloadResults.tsx(36,44)\n' +
#0 45.62     "      TS18047: 'source' is possibly 'null'.",
#0 45.62   moduleId: null,
#0 45.62   moduleTrace: [
#0 45.62     {
#0 45.62       originIdentifier: '/app/node_modules/babel-loader/lib/index.js??ruleSet[1].rules[0].rules[0]!/app/node_modules/ts-loader/index.js??ruleSet[1].rules[0].rules[1]!/app/node_modules/@pldn/ldwizard/src/containers/Publish/index.tsx',
#0 45.62       originName: './node_modules/@pldn/ldwizard/src/containers/Publish/index.tsx',
#0 45.62       moduleIdentifier: '/app/node_modules/babel-loader/lib/index.js??ruleSet[1].rules[0].rules[0]!/app/node_modules/ts-loader/index.js??ruleSet[1].rules[0].rules[1]!/app/node_modules/@pldn/ldwizard/src/containers/Publish/DownloadResults.tsx',
#0 45.62       moduleName: './node_modules/@pldn/ldwizard/src/containers/Publish/DownloadResults.tsx',
#0 45.62       dependencies: [Array],
#0 45.62       originId: null,
#0 45.62       moduleId: null
#0 45.62     },
#0 45.62     {
#0 45.62       originIdentifier: '/app/node_modules/babel-loader/lib/index.js??ruleSet[1].rules[0].rules[0]!/app/node_modules/ts-loader/index.js??ruleSet[1].rules[0].rules[1]!/app/node_modules/@pldn/ldwizard/src/containers/Wizard/index.tsx',
#0 45.62       originName: './node_modules/@pldn/ldwizard/src/containers/Wizard/index.tsx',
#0 45.62       moduleIdentifier: '/app/node_modules/babel-loader/lib/index.js??ruleSet[1].rules[0].rules[0]!/app/node_modules/ts-loader/index.js??ruleSet[1].rules[0].rules[1]!/app/node_modules/@pldn/ldwizard/src/containers/Publish/index.tsx',
#0 45.62       moduleName: './node_modules/@pldn/ldwizard/src/containers/Publish/index.tsx',
#0 45.62       dependencies: [Array],
#0 45.62       originId: null,
#0 45.62       moduleId: null
#0 45.62     },
#0 45.62     {
#0 45.62       originIdentifier: '/app/node_modules/babel-loader/lib/index.js??ruleSet[1].rules[0].rules[0]!/app/node_modules/ts-loader/index.js??ruleSet[1].rules[0].rules[1]!/app/node_modules/@pldn/ldwizard/src/containers/App/index.tsx',
#0 45.62       originName: './node_modules/@pldn/ldwizard/src/containers/App/index.tsx',
#0 45.62       moduleIdentifier: '/app/node_modules/babel-loader/lib/index.js??ruleSet[1].rules[0].rules[0]!/app/node_modules/ts-loader/index.js??ruleSet[1].rules[0].rules[1]!/app/node_modules/@pldn/ldwizard/src/containers/Wizard/index.tsx',
#0 45.62       moduleName: './node_modules/@pldn/ldwizard/src/containers/Wizard/index.tsx',
#0 45.62       dependencies: [Array],
#0 45.62       originId: null,
#0 45.62       moduleId: null
#0 45.62     },
#0 45.62     {
#0 45.62       originIdentifier: '/app/node_modules/babel-loader/lib/index.js??ruleSet[1].rules[0].rules[0]!/app/node_modules/ts-loader/index.js??ruleSet[1].rules[0].rules[1]!/app/node_modules/@pldn/ldwizard/src/index.tsx',
#0 45.62       originName: './node_modules/@pldn/ldwizard/src/index.tsx',
#0 45.62       moduleIdentifier: '/app/node_modules/babel-loader/lib/index.js??ruleSet[1].rules[0].rules[0]!/app/node_modules/ts-loader/index.js??ruleSet[1].rules[0].rules[1]!/app/node_modules/@pldn/ldwizard/src/containers/App/index.tsx',
#0 45.62       moduleName: './node_modules/@pldn/ldwizard/src/containers/App/index.tsx',
#0 45.62       dependencies: [Array],
#0 45.62       originId: null,
#0 45.62       moduleId: null
#0 45.62     }
#0 45.62   ],
#0 45.62   details: 'ts-loader-default_1b852a78f98b340c',
#0 45.62   stack: 'Error: [tsl] ERROR in /app/node_modules/@pldn/ldwizard/src/containers/Publish/DownloadResults.tsx(36,44)\n' +
#0 45.62     "      TS18047: 'source' is possibly 'null'.\n" +
#0 45.62     '    at makeError (/app/node_modules/ts-loader/dist/utils.js:93:19)\n' +
#0 45.62     '    at /app/node_modules/ts-loader/dist/utils.js:63:27\n' +
#0 45.62     '    at Array.map (<anonymous>)\n' +
#0 45.62     '    at formatErrors (/app/node_modules/ts-loader/dist/utils.js:46:14)\n' +
#0 45.62     '    at /app/node_modules/ts-loader/dist/after-compile.js:153:66\n' +
#0 45.62     '    at Array.forEach (<anonymous>)\n' +
#0 45.62     '    at provideErrorsToWebpack (/app/node_modules/ts-loader/dist/after-compile.js:150:31)\n' +
#0 45.62     '    at /app/node_modules/ts-loader/dist/after-compile.js:36:9\n' +
#0 45.62     '    at /app/node_modules/ts-loader/dist/instances.js:203:13\n' +
#0 45.62     '    at fn (/app/node_modules/webpack/lib/Compilation.js:478:10)\n' +
#0 45.62     '    at _next0 (eval at create (/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:63:1)\n' +
#0 45.62     '    at eval (eval at create (/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:76:1)\n' +
#0 45.62     '    at /app/node_modules/webpack/lib/Compilation.js:521:10\n' +
#0 45.62     '    at /app/node_modules/html-webpack-plugin/lib/cached-child-compiler.js:267:53\n' +
#0 45.62     '    at runMicrotasks (<anonymous>)\n' +
#0 45.62     '    at processTicksAndRejections (node:internal/process/task_queues:96:5)'
#0 45.62 }
#0 45.62 Something went wrong: Failed to compile LD-Wizard
#0 45.83 error Command failed with exit code 1.
#0 45.83 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
------
failed to solve: executor failed running [/bin/sh -c yarn build]: exit code: 1

Note that doing yarn dev directly in the LDWizard repository to start the service in development from the source code works fine.

Any idea what's the problem?

philipperenzen commented 1 year ago

Hi @vemonet, it seems these issues were related to outdated packages. The current updated version of the library should not throw errors when building.

I'll close this issue for now, but please reopen the issue if errors persist.