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

microbit.umd.js:1 - Failed to load resource: net::ERR_FILE_NOT_FOUND #37

Open
sistemathead opened this issue Jul 9, 2024 · 2 comments

Comments

@sistemathead
Copy link

Hello thegecko !!

Thanks for your library !!

We are trying to execute the examples/index.html

but we are getting this error:

microbit.umd.js:1
Failed to load resource: net::ERR_FILE_NOT_FOUND
5index.html:18 Uncaught (in promise) ReferenceError: microbit is not defined
at document.getElementById.onclick (index.html:18:32)

do you think we need to make anything else before?

thank you !!

@sistemathead
Copy link
Author

this is when we press "connect" button
we are trying, to use the server.getPrimaryServices()

but this instruction is hang out

@thegecko
Copy link
Owner

The solution here probably depends on how you are running the module.

If you installed it via npm, e.g.:

> npm i microbit-web-bluetooth

Then you will need to point your example at the correct path:

<html>
    <head>
        <title>micro:bit</title>
        <script type="text/javascript" src="node_modules/microbit-web-bluetooth/dist/microbit.umd.js"></script>
    </head>
    ...

However, if you are using this component from source (e.g. cloned this repo), you'll need to build it before the component appears in the dist folder:

> git clone https://github.com/thegecko/microbit-web-bluetooth
> cd microbit-web-bluetooth
> npm i
> npm run build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants