question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when transpiling using Rollupjs

See original GitHub issue

I’m attempting to import newrelic using rollupjs as a transpiler.

import 'newrelic'
TypeError [ERR_INVALID_ARG_TYPE]: The "superCtor" argument must be of type function. Received undefined
    at new NodeError (node:internal/errors:278:15)
    at inherits (node:util:158:11)
    at Object.<anonymous> (/path/to/mypackage.js:100637:1)
    at Module._compile (node:internal/modules/cjs/loader:1108:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
    at Module.load (node:internal/modules/cjs/loader:973:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'ERR_INVALID_ARG_TYPE'
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
carlo-808commented, Jan 14, 2021

@btakita OK, gotcha. Yeah, the node -r thing will not work in that situation. I’ll bring this up with our team and try to get rollup support prioritized.

1reaction
btakitacommented, Jan 13, 2021

I’m also noticing some circular dependencies. I’m using sapper 0.28.10, rollup ^2.36.1, pnpm 5.15.0, nodejs 15.5.1

Circular dependency: ../../node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/_stream_readable.js -> ../../node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/_stream_duplex.js -> ../../node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/_stream_readable.js
Circular dependency: ../../node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/_stream_duplex.js -> ../../node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/_stream_writable.js -> ../../node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/_stream_duplex.js
Circular dependency: ../../node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/_stream_duplex.js -> ../../node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/_stream_writable.js -> /home/brian/work/menus/menus-angular-2-app-sapper/node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/_stream_duplex.js?commonjs-proxy -> ../../node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/_stream_duplex.js
Circular dependency: ../../node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/_stream_readable.js -> ../../node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/_stream_duplex.js -> /home/brian/work/menus/menus-angular-2-app-sapper/node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/_stream_readable.js?commonjs-proxy -> ../../node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/_stream_readable.js
Circular dependency: ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/util/unwrapped-core.js -> ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/util/copy.js -> ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/util/properties.js -> ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/logger.js -> ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/util/unwrapped-core.js
Circular dependency: ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/util/copy.js -> ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/util/properties.js -> ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/logger.js -> ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/config/index.js -> ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/util/copy.js
Circular dependency: ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/util/unwrapped-core.js -> ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/util/copy.js -> ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/util/properties.js -> ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/logger.js -> ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/config/index.js -> ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/util/unwrapped-core.js
Circular dependency: ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/logger.js -> ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/config/index.js -> ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/util/process-version.js -> ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/logger.js
Circular dependency: ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/logger.js -> ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/config/index.js -> ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/util/process-version.js -> /home/brian/work/menus/menus-angular-2-app-sapper/node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/logger.js?commonjs-proxy -> ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/logger.js
Circular dependency: ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/logger.js -> ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/config/index.js -> ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/logger.js
Circular dependency: ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/util/copy.js -> ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/util/properties.js -> ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/logger.js -> ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/config/index.js -> /home/brian/work/menus/menus-angular-2-app-sapper/node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/util/copy.js?commonjs-proxy -> ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/util/copy.js
Circular dependency: ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/util/unwrapped-core.js -> ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/util/copy.js -> ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/util/properties.js -> ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/logger.js -> ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/config/index.js -> /home/brian/work/menus/menus-angular-2-app-sapper/node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/util/unwrapped-core.js?commonjs-proxy -> ../../node_modules/.pnpm/newrelic@7.1.0/node_modules/newrelic/lib/util/unwrapped-core.js
Read more comments on GitHub >

github_iconTop Results From Across the Web

Babel / Rollup errors transpiling and bundling ES2017
I'm getting an error transpiling ES2017 JavaScript (specifically async/await functions) into ES5 using Rollup and Babel:.
Read more >
@rollup/plugin-commonjs - npm
Start using @rollup/plugin-commonjs in your project by running `npm i ... that non-JavaScript files are transpiled by another plugin first.
Read more >
rollup.js
Using this option will make Rollup transpile your configuration file to an ES ... Exit the build with an error if any warnings...
Read more >
3 Options to Compile Typescript to JS: Rollup, TSC, Babel
Setting up Rollup is slick with a simple rollup.config.js file. ... avoid the Linting error: error TS2307: Cannot find module 'moduleA'.
Read more >
An Introduction to the Rollup.js JavaScript Bundler - SitePoint
The examples below specifically use npx rollup , since it will work ... it easier to set breakpoints or locate problems when errors...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found