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

Clean install seems to fail #87

Closed holtkamp closed 1 year ago

holtkamp commented 1 year ago

When trying to get LD-Wizard up and running by following the instructions in here: https://github.com/pldn/LDWizard/blob/294acec01339be92df6749ed4b75ba050cb7a07c/CONFIGURING.md

It seems building a LD-Wizard fails.

Context:

node -v
v19.3.0

yarn -v
1.22.19

Steps taken:

mkdir my-wizard
cd my-wizard

echo '--ignore-engines true' > .yarnrc

yarn add @pldn/ldwizard

This takes 130 seconds, installs 960 (!) dependencies and results in the following package.json:

{
  "dependencies": {
    "@pldn/ldwizard": "^2.0.0"
  }
}

Let's continue:

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

window.config = wizardConfig;' >  config.ts

yarn exec ldwizard-build config.ts

This last command results in the following error:

yarn exec v1.22.19
warning package.json: No license field
Config found at /private/tmp/my-wizard/config.ts
Start webpack compilation
[LD-Wizard] Compiling 
{
  file: '/private/tmp/my-wizard/node_modules/@pldn/ldwizard/src/containers/Configure/ClassField.tsx',
  moduleIdentifier: '/private/tmp/my-wizard/node_modules/babel-loader/lib/index.js??ruleSet[1].rules[0].rules[0]!/private/tmp/my-wizard/node_modules/ts-loader/index.js??ruleSet[1].rules[0].rules[1]!/private/tmp/my-wizard/node_modules/@pldn/ldwizard/src/containers/Configure/ClassField.tsx',
  moduleName: './node_modules/@pldn/ldwizard/src/containers/Configure/ClassField.tsx',
  loc: '63:6-11',
  message: '\x1B[90m[tsl] \x1B[39m\x1B[1m\x1B[31mERROR\x1B[39m\x1B[22m\x1B[1m\x1B[31m in \x1B[39m\x1B[22m\x1B[1m\x1B[36m/private/tmp/my-wizard/node_modules/@pldn/ldwizard/src/containers/Configure/ClassField.tsx(63,7)\x1B[39m\x1B[22m\n' +
    "\x1B[1m\x1B[31m      TS2322: Type 'string' is not assignable to type 'any[]'.\x1B[39m\x1B[22m",
  moduleId: null,
  moduleTrace: [
    {
      originIdentifier: '/private/tmp/my-wizard/node_modules/babel-loader/lib/index.js??ruleSet[1].rules[0].rules[0]!/private/tmp/my-wizard/node_modules/ts-loader/index.js??ruleSet[1].rules[0].rules[1]!/private/tmp/my-wizard/node_modules/@pldn/ldwizard/src/containers/Configure/index.tsx',
      originName: './node_modules/@pldn/ldwizard/src/containers/Configure/index.tsx',
      moduleIdentifier: '/private/tmp/my-wizard/node_modules/babel-loader/lib/index.js??ruleSet[1].rules[0].rules[0]!/private/tmp/my-wizard/node_modules/ts-loader/index.js??ruleSet[1].rules[0].rules[1]!/private/tmp/my-wizard/node_modules/@pldn/ldwizard/src/containers/Configure/ClassField.tsx',
      moduleName: './node_modules/@pldn/ldwizard/src/containers/Configure/ClassField.tsx',
      dependencies: [Array],
      originId: null,
      moduleId: null
    },
    {
      originIdentifier: '/private/tmp/my-wizard/node_modules/babel-loader/lib/index.js??ruleSet[1].rules[0].rules[0]!/private/tmp/my-wizard/node_modules/ts-loader/index.js??ruleSet[1].rules[0].rules[1]!/private/tmp/my-wizard/node_modules/@pldn/ldwizard/src/containers/Wizard/index.tsx',
      originName: './node_modules/@pldn/ldwizard/src/containers/Wizard/index.tsx',
      moduleIdentifier: '/private/tmp/my-wizard/node_modules/babel-loader/lib/index.js??ruleSet[1].rules[0].rules[0]!/private/tmp/my-wizard/node_modules/ts-loader/index.js??ruleSet[1].rules[0].rules[1]!/private/tmp/my-wizard/node_modules/@pldn/ldwizard/src/containers/Configure/index.tsx',
      moduleName: './node_modules/@pldn/ldwizard/src/containers/Configure/index.tsx',
      dependencies: [Array],
      originId: null,
      moduleId: null
    },
    {
      originIdentifier: '/private/tmp/my-wizard/node_modules/babel-loader/lib/index.js??ruleSet[1].rules[0].rules[0]!/private/tmp/my-wizard/node_modules/ts-loader/index.js??ruleSet[1].rules[0].rules[1]!/private/tmp/my-wizard/node_modules/@pldn/ldwizard/src/containers/App/index.tsx',
      originName: './node_modules/@pldn/ldwizard/src/containers/App/index.tsx',
      moduleIdentifier: '/private/tmp/my-wizard/node_modules/babel-loader/lib/index.js??ruleSet[1].rules[0].rules[0]!/private/tmp/my-wizard/node_modules/ts-loader/index.js??ruleSet[1].rules[0].rules[1]!/private/tmp/my-wizard/node_modules/@pldn/ldwizard/src/containers/Wizard/index.tsx',
      moduleName: './node_modules/@pldn/ldwizard/src/containers/Wizard/index.tsx',
      dependencies: [Array],
      originId: null,
      moduleId: null
    },
    {
      originIdentifier: '/private/tmp/my-wizard/node_modules/babel-loader/lib/index.js??ruleSet[1].rules[0].rules[0]!/private/tmp/my-wizard/node_modules/ts-loader/index.js??ruleSet[1].rules[0].rules[1]!/private/tmp/my-wizard/node_modules/@pldn/ldwizard/src/index.tsx',
      originName: './node_modules/@pldn/ldwizard/src/index.tsx',
      moduleIdentifier: '/private/tmp/my-wizard/node_modules/babel-loader/lib/index.js??ruleSet[1].rules[0].rules[0]!/private/tmp/my-wizard/node_modules/ts-loader/index.js??ruleSet[1].rules[0].rules[1]!/private/tmp/my-wizard/node_modules/@pldn/ldwizard/src/containers/App/index.tsx',
      moduleName: './node_modules/@pldn/ldwizard/src/containers/App/index.tsx',
      dependencies: [Array],
      originId: null,
      moduleId: null
    }
  ],
  details: 'ts-loader-default_840d15d438e05a67',
  stack: 'Error: \x1B[90m[tsl] \x1B[39m\x1B[1m\x1B[31mERROR\x1B[39m\x1B[22m\x1B[1m\x1B[31m in \x1B[39m\x1B[22m\x1B[1m\x1B[36m/private/tmp/my-wizard/node_modules/@pldn/ldwizard/src/containers/Configure/ClassField.tsx(63,7)\x1B[39m\x1B[22m\n' +
    "\x1B[1m\x1B[31m      TS2322: Type 'string' is not assignable to type 'any[]'.\x1B[39m\x1B[22m\n" +
    '    at makeError (/private/tmp/my-wizard/node_modules/ts-loader/dist/utils.js:93:19)\n' +
    '    at /private/tmp/my-wizard/node_modules/ts-loader/dist/utils.js:63:27\n' +
    '    at Array.map (<anonymous>)\n' +
    '    at formatErrors (/private/tmp/my-wizard/node_modules/ts-loader/dist/utils.js:46:14)\n' +
    '    at /private/tmp/my-wizard/node_modules/ts-loader/dist/after-compile.js:153:66\n' +
    '    at Array.forEach (<anonymous>)\n' +
    '    at provideErrorsToWebpack (/private/tmp/my-wizard/node_modules/ts-loader/dist/after-compile.js:150:31)\n' +
    '    at /private/tmp/my-wizard/node_modules/ts-loader/dist/after-compile.js:36:9\n' +
    '    at /private/tmp/my-wizard/node_modules/ts-loader/dist/instances.js:203:13\n' +
    '    at fn (/private/tmp/my-wizard/node_modules/webpack/lib/Compilation.js:478:10)\n' +
    '    at _next0 (eval at create (/private/tmp/my-wizard/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:63:1)\n' +
    '    at eval (eval at create (/private/tmp/my-wizard/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:76:1)\n' +
    '    at /private/tmp/my-wizard/node_modules/webpack/lib/Compilation.js:521:10\n' +
    '    at /private/tmp/my-wizard/node_modules/html-webpack-plugin/lib/cached-child-compiler.js:267:53\n' +
    '    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)'
}
Something went wrong: Failed to compile LD-Wizard
error Command failed.
Exit code: 1
Command: ldwizard-build
Arguments: config.ts
Directory: /private/tmp/my-wizard
Output:

info Visit https://yarnpkg.com/en/docs/cli/exec for documentation about this command.

For me as a newbie, this is where my effort ends...

Any help is appreciated!

EnnoMeijers commented 1 year ago

Thanks for reporting this bug, we will look into it!

In the meantime you could have a look at one of the variants mentioned in the Readme. I managed to do a clean install for the ErfgoedWizard earlier this week.

ErfgoedWizard variant is tailored for use with cultural heritage collections, one of the features is a basic refinement function using the several terminology sources in the cultural heritage domain (through the network-of-terms api). It maps mainly to schema.org properties. See the for more details about the used vocabularies the getAllowedPrefixes function defined in the config.ts.

philipperenzen commented 1 year ago

@holtkamp I updated the markdown instructions and upgraded the packages. The installation with the updated version of the @pldn/ldwizard package should work without throwing errors. I'll close this issue for now, but please reopen the issue if the installation errors persist.

holtkamp commented 1 year ago

@philipperenzen

gave it a try, but got a white page with error:

Wizard-base.min.js:125 Uncaught TypeError: Cannot read properties of undefined (reading 'appName')
    at LDWizard-base.min.js:125:192063
    at LDWizard-base.min.js:152:82818
    at LDWizard-base.min.js:152:82824
    at LDWizard-base.min.js:2:406
    at LDWizard-base.min.js:2:526
(

Apparently in ./lib/config.min.js

I needed to change:

return globalThis.config = {},

in:

return globalThis.wizardConfig = {},

Then it worked...