Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I use 13.0 in the browser? #1352

Closed
guanxun14 opened this issue Jun 17, 2020 · 3 comments
Closed

How do I use 13.0 in the browser? #1352

guanxun14 opened this issue Jun 17, 2020 · 3 comments
Assignees
Labels

Comments

@guanxun14
Copy link

Hi, I'm just setting up a new project and wanted to use Kinto for it.

However, including version 13.0.0 of kinto.min.js directly in the browser via a script tag returns a referenceError global not defined error. I suppose this is because this recently-released version was re-written in TypeScript, since 12.7 is working fine.

Looking up the history of that release:

One of the biggest drawbacks to migrating to TypeScript is increasing the barrier to entry for developers who aren't familiar with TypeScript. However, this is offset by adding stronger type checking to library internals, which actually makes it easier for developers to contribute high-quality code.

and

If Kinto is written in TypeScript, would it be possible to use it without TypeScript?
Yes! Even if the project is written in TypeScript, all consumed versions of the library will be written in JavaScript. If you use a TypeScript-aware tool like VS Code, you'll even get type checking for your JavaScript code when interacting with Kinto.

May I have some simple guidance or be pointed to some reference on how may I get this going? At the moment I'm honestly clueless and can't seem to find how to get this to work.

Thank you :)

@dstaley dstaley self-assigned this Jun 18, 2020
@dstaley dstaley added the bug label Jun 18, 2020
@dstaley
Copy link
Member

dstaley commented Jun 18, 2020

Thank you for reporting this! It looks like the issue is actually due to our usage of rollup-plugin-node-builtins, which I'm actually planning on removing in v14.

In the meantime, I believe if you put window.global = {}; somewhere before where you load in the script that should get things working. I'll try and get v14 out tomorrow!

@guanxun14
Copy link
Author

window.global = {};

That does fix it, thanks for the quick response! Looking forward to v14 :)

@dstaley
Copy link
Member

dstaley commented Jun 18, 2020

v14 is live on npm!

@dstaley dstaley closed this as completed Jun 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants