-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
I am trying a dynamic import in chrome. I have
const { default: Papa } = await import('papaparse');
const csv = Papa.parse(data);but I get the error Uncaught (in promise) TypeError: Cannot set properties of undefined (setting 'Papa') which traces to the module code
(function(root, factory)
{
/* globals define */
if (typeof define === 'function' && define.amd)
{
// AMD. Register as an anonymous module.
define([], factory);
}
else if (typeof module === 'object' && typeof exports !== 'undefined')
{
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory();
}
else
{
// Browser globals (root is window)
root.Papa = factory();
}
// in strict mode we cannot access arguments.callee, so we need a named reference to
// stringify the factory method for the blob worker
// eslint-disable-next-line func-name
}(this, function moduleFactory()This is being used in the lit element library, which is a web component library using shadow dom. Am I doing anything wrong in the above to cause this error?
Metadata
Metadata
Assignees
Labels
No labels