GithubHelp home page GithubHelp logo

Comments (8)

mgmarlow avatar mgmarlow commented on August 16, 2024 1

@perseus086 @CedricDumont Can you double-check that your tsconfig.app.json has an entry for "module": "esnext"?

Example:

{ 
  "extends": "../tsconfig.json", 
  "compilerOptions": { 
    "outDir": "../out-tsc/app", 
    "baseUrl": "./", 
    "module": "esnext", 
    "types": [] }, 
    "exclude": [ 
      "test.ts", 
      "**/*.spec.ts" 
    ] 
  }
}

from angular-playground.

CedricDumont avatar CedricDumont commented on August 16, 2024

for more info if ever needed
the generated sandboxes.ts

import { default as s1 } from './app/note/note.component.sandbox';
export let sandboxes: any[] = [];
sandboxes.push(s1.serialize('NoteComponent'));

from angular-playground.

lurock avatar lurock commented on August 16, 2024

Try using the 2.x version just released and see if you are still having issues.

from angular-playground.

CedricDumont avatar CedricDumont commented on August 16, 2024

I have updated, now I have this error showing up from ng serve:


ERROR in ..../src/sandboxes.ts (7,8): Expression expected.
ERROR in /.../src/sandboxes.ts (7,14): Unreachable code detected.
ERROR in /...../src/sandboxes.ts (7,70): Property 'then' does not exist on type '"./app/command-input/command-input.component.sandbox"'.

I just created a new fresh project (ng client project), then followed instruction on website and just started:
yarn run playground.

sandbox file looks like this

export function getSandboxMenuItems() {
return [{"key":"./app/command-input/command-input.component.sandbox","searchKey":"CommandInputComponent","name":"CommandInputComponent","label":"","scenarioMenuItems":[{"key":1,"description":"simple test"}]}];
}
export function getSandbox(path: string) {
switch(path) {
case './app/command-input/command-input.component.sandbox':
return import('./app/command-input/command-input.component.sandbox').then(sandbox => { return sandbox.default.serialize('./app/command-input/command-input.component.sandbox'); });
}}

from angular-playground.

lurock avatar lurock commented on August 16, 2024

This error is caused because the new version of Angular Playground 2.0.0 or higher requires you use Typescript 2.4 or higher. Change your devDependencies for typescript to be version 2.4.x or higher and this should resolve your issue. We are updating or docs and will have a requirements page up on the web shortly.

from angular-playground.

perseus086 avatar perseus086 commented on August 16, 2024

After upgrading to typescript 2.4.2 I got the following error:

.../map/src/sandboxes.ts (7,8): Dynamic import cannot be used when targeting ECMAScript 2015 modules.

How can I solve this issue?

from angular-playground.

CedricDumont avatar CedricDumont commented on August 16, 2024

I also upgraded to typescript 2.4.2 and using the very last angular cli and still same error as @perseus086

from angular-playground.

perseus086 avatar perseus086 commented on August 16, 2024

Adding "module": "esnext" fixed the issue.

Thank you @mgmarlow 😃

from angular-playground.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.