digitalbazaar / jsonld.js

A JSON-LD Processor and API implementation in JavaScript
https://json-ld.org/
Other
1.66k stars 195 forks source link

Property name expected type of string but got null #367

Open MarkLyck opened 4 years ago

MarkLyck commented 4 years ago

Description
Trying to build a React App using jsonld in a sub node_module causes the following error.

/Users/xxxxxx/node_modules/jsonld/lib/jsonld.js: /Users/xxxxxx/node_modules/jsonld/lib/jsonld.js: Property name expected type of string but got null

There's only one instance of jsonld. v1.8.1

@xxx/xxxxxxx@1.0.0 /Users/xxxxxx
└─┬ @api-platform/admin@2.0.1
  ├─┬ @api-platform/api-doc-parser@0.8.2
  │ └── jsonld@1.8.1  deduped
  └── jsonld@1.8.1 

Builder Parcel.

.babelrc

  presets: ["@babel/preset-react"],
  plugins: [
    "styled-components",
    [
      "module-resolver",
      {
        root: ["."],
        alias: {
          common: "./src/common",
          components: "./src/components",
          tests: "./tests"
        }
      }
    ]
  ]
};

.tsconfig

  "compilerOptions": {
    "outDir": "./dist/",
    "module": "esNext",
    "strictNullChecks": true,
    "moduleResolution": "node",
    "esModuleInterop": true,
    "experimentalDecorators": true,
    "jsx": "react",
    "noUnusedParameters": true,
    "noUnusedLocals": true,
    "noImplicitAny": true,
    "noImplicitThis": true,
    "declaration": true,
    "allowSyntheticDefaultImports": true,
    "emitDecoratorMetadata": true,
    "target": "es2019",
    "lib": ["es5", "es6", "es7", "es2017", "dom"],
    "sourceMap": true,
    "types": ["react", "jest", "node"],
    "baseUrl": "src",
    "paths": {
      "common/*": ["src/common/*"],
      "components/*": ["src/components/*"],
      "tests/*": ["tests/*"]
    }
  },
  "include": ["src/**/*", "src/typings.d.ts"],
  "exclude": ["./node_modules", "dist"]
}

I believe this might be caused by. the destructured require imports in the jsonld.js file

davidlehn commented 4 years ago

Do you have the line number or the offending code? Hard to guess where the problem might be.