Skip to main content

Questions tagged [babeljs]

Babel (formerly 6to5) is a JavaScript compiler. It transforms ES6+/ES2015 code into ES5 code.

1 vote
0 answers
109 views

React Hooks Behavior: Difference When Using variables and states in useCallback before their Definition (ES5)

I have a doubt regarding, how hooks like useCallback() work when the variables, arrow functions, and states used in it and its dependency, are declared before and after the useCallback(). Note: The ...
jd singh's user avatar
0 votes
0 answers
39 views

Module not found / build failed in my yarn workspaces monorepo

I am combining my React web application with my Expo React Native mobile app into a monorepo using yarn workspaces because they both need to share some utils, queries, etc. My file structure is ...
jchm's user avatar
  • 83
-1 votes
0 answers
25 views

After changed import path, getting Missing semicolon error when running tests

when I run tests, I am getting SyntaxError : Missing semicolon. I have checked the jest documentation and looks like babel config file is correctly configured. module.exports = { presets: ['@babel/...
Guga Todua's user avatar
0 votes
1 answer
34 views

How do I fix Cannot find module 'babel-preset-metro-react-native-babel-preset' error whenever I run npx expo start?

Every time I run npx expo start, I get this error and am unable to load my app: error: node_modules/expo-router/entry.js: Cannot find module 'babel-preset-metro-react-native-babel-preset' Require ...
Olivia Zhang's user avatar
0 votes
0 answers
49 views

setTimeout() is not Working in Jets Unit Test

Here I have perform testing on jest. When I tested for setTimeout() function, it didn’t work. Any help would be appreciated. I have followed this documentation: https://jestjs.io/docs/timer-mocks ...
Jay Patel's user avatar
0 votes
0 answers
14 views

Can't get Babel demo to play nice with the pipeline operator

Babel's online demo is...unintuitive. I'm trying to use it to test out the pipeline operator proposals for ECMAScript. I thought it would be as simple as selecting the proper plugins, but no. I have ...
Melab's user avatar
  • 2,704
0 votes
0 answers
15 views

@parcel/packager-js: External modules are not supported when building for browser this is error i am facing when running my react on build

@parcel/packager-js: External modules are not supported when building for browser > 1 | import React from "react"; > | ^ > 2 | import ReactDOM from "react-dom/client"; &...
Aditya Bansal's user avatar
0 votes
0 answers
54 views

error: Error: Unable to resolve module missing-asset-registry-path from "path"

"error: Error: Unable to resolve module missing-asset-registry-path from C:\Users\USER\Desktop\picky_anu_anshif\node_modules\react-native\Libraries\LogBox\UI\LogBoxImages\chevron-right.png: ...
Anu Robinson's user avatar
0 votes
1 answer
71 views

Next.js / ESLint – "Parsing error: Cannot find module 'next/babel'"

Every time I create a Next.js app with: `npx create-next-app@latest` ESLint immediately starts flashing warnings in all my .js files saying "Parsing error: Cannot find module 'next/babel' ...
Henrik Angelstig's user avatar
0 votes
1 answer
57 views

Injecting Comments with a SWC Rust plugin

I am trying to inject a comment to existing javascript code. In Babel there is the addComment helper which can be called on a AST node. Here is a simple (but rather silly) transformation written in ...
jantimon's user avatar
  • 37.7k
0 votes
0 answers
68 views

I'm encountering a `SyntaxError: Unexpected token 'export'` when running Jest tests in my React project

I'm encountering a SyntaxError: Unexpected token 'export' error in Jest tests for my React application, Seeking solutions to resolve this configuration issue in Jest. SyntaxError: Unexpected token '...
Vin's user avatar
  • 23
15 votes
1 answer
6k views

(Handle Polyfill.io Security-Alert) How do you detect if a big npm Codebase uses Polyfill.io somewhere?

Polyfill.io is malicious: https://dev.to/snyk/polyfill-supply-chain-attack-embeds-malware-in-javascript-cdn-assets-55d6 I now need to find it my codebase: I used: grep -r "polyfill.io" to ...
telion's user avatar
  • 1,062
0 votes
0 answers
51 views

Jest running failed: Unexpected token 'export'

I'm trying to run my tests using jest and I keep facing this error Details: /Users/mamad/repos/New Mindro-ai/mindro-dev/web-client/node_modules/react-markdown/index.js:9 export {Markdown ...
Mohamad Askari's user avatar
0 votes
1 answer
21 views

I have folder named dist that was generated using Babel. Can I directly use the contents of this folder in a new react project?

I have a React library that is published on npm. I follow the below steps for publishing on npm I generate a folder named dist using Babel by running the command- babel ./src -d ./dist Then I ...
Abhinandan Kushwaha's user avatar
0 votes
0 answers
46 views

Playwright - SyntaxError: Unexpected token 'export' - external npm package

I have created npm package in order to use it withing our organization. It containing some reusable code for testing. It is published to our internal feed and i have installed in destination project ...
marslfc's user avatar

15 30 50 per page
1
2 3 4 5
651