Skip to content
Discussions/App Development/No Daml.Script import?Forum ↗

No Daml.Script import?

App Development6 posts2,297 views10 likesLast activity Jul 2021
AN
anthonyOP
Mar 2020

I’m following along with the DAML Script docs but getting an error on import Daml.Script

Could not find module ‘Daml.Script’
It is not a module in the current program, or in any known package.

My daml.yaml looks like this:

sdk-version: 0.13.55
name: szabo_car_contract
version: 1.0.0
source: daml/Main.daml
scenario: Main:mainScenario
parties:
- Alice
- Bob
exposed-modules:
- Main
dependencies:
- daml-prim
- daml-stdlib
- daml-script
AN
anthony
Mar 2020

Restarting DAML Studio (ie. exit Visual Studio Code, run daml studio again) fixed the import issue.

BE
bernhard
Apr 2020

The other possible cause is that DAML Studio (/VS Code) has to be opened on the directory containing the daml.yaml file. For example, you have a foo/bar/daml.yaml project root, and open VS Code in foo, it will fail to resolve the DAML Script library. This is a known issue: #5455

QU
quidagis
Jun 2021

As @bernhard states, you need to open the Project directory containing the daml.yaml else VS Code outputs an error. Following his advice, error gone :+1:t2:

GA
Gary_Verhaegen
Jun 2021

Could you clarify what exactly the issue is? Maybe provide reproducing steps?

daml new t
cd t
daml studio

yields a working import Daml.Script for me.

AR
Arin_Aggarwal
Jul 2021

Ensure that when creating the new DAML project that you cd into it before “Daml studio”

← Back to Discussions