Comments (7)
@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.
@msasikanth Hello! If you can provide me a simple stand-alone script, I can take a look.
from kotlin-playground.
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.
@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.
@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.
@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.
So best option right now is to use the ReactJS or use the script tag?
from kotlin-playground.
Related Issues (20)
- Kotlin coroutines possible bug with `GlobalScope.launch` HOT 1
- [Bug] Online playground is not working when use `Executors.newSingleThreadExecutor().asCoroutineDispatcher()` as CorotuineDisaptcher
- no way to pass compiler options? HOT 1
- Full source for play.kotlinlang.org available? HOT 4
- JS IR compiler cannot find dependency HOT 1
- ability to use arguments that contain spaces HOT 1
- The code doesn't compile
- cannot create a `hashMap` from a `List<Pair<String, String>>` by using `hashMapOf` HOT 5
- Following a link to playground breaks browser back button
- Editor & console flickering
- remainder operator two is not zero student grades algorithm
- How to pass command line arguments dynamically HOT 1
- Code is automatically indented with spaces, but tabs are still inserted when I use the `Tab` key
- No main method found in project. HOT 1
- Adjustable height of console window for small size screens HOT 1
- tst
- How to change code from JS HOT 1
- Unexpected println output HOT 2
- Kotlin 2.0.0-Beta 2 on Kotlin Playground HOT 4
- String.substringAfter(String) behaves incorrectly
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kotlin-playground.