Shakes
Shakes

Reputation: 11

Cannot find module - Script-Lab

I have a code snippet at the very top of my ScriptLab code. This file holds certain reusable items that I want to use, so I it's written as a class elsewhere in the same directory as my Excel file.

import * as config2 from "https://ABCDEF.sharepoint.com/sites/ABCDEF/PCI%20Work/config2.js";

However the code is flagged with the following message

"Cannot find module 'https://ABCDEF.sharepoint.com/sites/ABCDEF/PCI%20Work/config2.js"

I have changed the location to a local directory on my machine and it's the same error.

When I go ahead to run the script regardless of the error, I get the following message in the console:

["'require' is not defined", "https://script-lab-runner.azureedge.net/", 60, 1, ReferenceError] 0: "'require' is not defined" 1: "https://script-lab-runner.azureedge.net/" 2: 60 3: 1 4: ReferenceError

Can anyone help with importing / using other .js files in ScriptLab?

Upvotes: 1

Views: 157

Answers (0)

Related Questions