feross / feross/buffer

Uncaught SyntaxError: Cannot use import statement outside a module

Open
#321 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.9k
Forks
260
PR merge metrics
No merged PRs in 30d

Description

Hi. I have attempted to add Buffer to my browser extension in the name of replacing the deprecated `btoa` method so that I may submit a pull request to Buildspace, whom have provided the extension's template. I have tried on multiple occasions in multiple ways to get the buffer to work but to no avail. The file in which I am trying to use buffer is the index.js at the root level of the app. Below I have attached screenshots and a link to my extension's repository so you can see the various changes I have made in attempting to get this to work. If you need any further info, please let me know. Thank you for your assistance.

https://github.com/SMSonGitHub/gpt3-writer-extension-sms
![buffer](https://user-images.githubusercontent.com/52727354/216306915-3c2c9fb2-a837-43fb-a8a9-7bc2f5349a3d.PNG)
![buffer 2](https://user-images.githubusercontent.com/52727354/216306922-6bc66eaa-217b-4fa9-9f12-31d03dca3c22.PNG)
![scripts](https://user-images.githubusercontent.com/52727354/216306944-325cb948-6ae1-4119-a356-9b6c3ececfbb.PNG)
![uncaught syntax error](https://user-images.githubusercontent.com/52727354/216307226-e70c4549-2ae8-470b-9069-c30b47d8b2b2.PNG)

I have recently installed webpack and that seems to make the errors go away. I am currently testing the app, but it seems there may still be some issues. Any and all good help would be appreciated.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.