Giter Site home page Giter Site logo

Comments (7)

AlexanderPrendota avatar AlexanderPrendota commented on May 27, 2024 1

@msasikanth Only client side. Kotlin-Playground can only be loaded in a browser environment (because it doesn't do anything useful outside of that).

from kotlin-playground.

AlexanderPrendota avatar AlexanderPrendota commented on May 27, 2024

@msasikanth Hello! If you can provide me a simple stand-alone script, I can take a look.

from kotlin-playground.

msasikanth avatar msasikanth commented on May 27, 2024

I am getting this error as soon as I use the import statement. Even before I write any script. But if still want the code I used it's the same as the one in read me file

import playground from 'kotlin-playground'; document.addEventListener('DOMContentLoaded', () => { playground('code'); // attach to all  elements });  

from kotlin-playground.

AlexanderPrendota avatar AlexanderPrendota commented on May 27, 2024

@msasikanth I just created simple ReactJS application and install playground via yarn add playground. Kotlin-playground works fine for me. So, Did you try to drop all node_modules and install ones again?

from kotlin-playground.

msasikanth avatar msasikanth commented on May 27, 2024

@AlexanderPrendota I created a simple webapp using expressjs from Idea, I added kotlin playground dependency using npm install kotlin-playground -S.

But as soon as I use import statement and run the webserver I am getting error again. I tried it without express js and a simple webapp from VisualStudio as well.

from kotlin-playground.

AlexanderPrendota avatar AlexanderPrendota commented on May 27, 2024

@msasikanth Oh. I see. Kotlin-Playground runs in the browser, it is written to rely on certain browser APIs. One such API it relies on is navigator. The same behavior as in CodeMirror.

Also, you can add playground via script tag:
<script src="https://unpkg.com/kotlin-playground@1" data-selector="code"></script>

from kotlin-playground.

msasikanth avatar msasikanth commented on May 27, 2024

So best option right now is to use the ReactJS or use the script tag?

from kotlin-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.