Next.js babel preset
See original GitHub issue1) Integration with Next.js (TypeScript)
I don’t know how can I fix the next problem:
import * as React from 'react';
// @ts-ignore : 'fbt' is declared but its value is never read.
import fbt from 'fbt';
console.log(fbt); // ( 1 )
// @ts-ignore
const node = <fbt desc='desc-text'>Some text</fbt>;
- When I commented on this line I get next build error:
fbt is not bound. Did you forget to require('fbt')
Did It mean that webpack bundle remove unused import before babel transpilation?
2) Empty childParentMappings:{}
And node_modules/babel-plugin-fbt/bin/collectFBT.js
couldn’t collect any phrases from code
DEMO Next.js App
dependencies": {
"fbt": "^0.9.51",
"babel-plugin-fbt": "^0.9.12",
"babel-plugin-fbt-runtime": "^0.9.1",
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
Advanced Features: Customizing Babel Config - Next.js
Next.js includes the next/babel preset to your app, which includes everything needed to compile React applications and server-side code.
Read more >Adding Babel presets and plugins in Next.js - Netlify
Next.js comes with several Babel presets built in, and chances are, it will cover most of what you'd like to use in your...
Read more >babel-preset-next - npm
babel preset used by myself. Latest version: 1.4.0, last published: 3 years ago. Start using babel-preset-next in your project by running ...
Read more >Adding Babel presets and plugins in Next.js
Next.js comes with several Babel presets built in, and chances are, it will cover most of what you'd like to use in your...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here is an article about Typescript + fbt where I describe problems that i faced and how to fix them
@retyui I followed your guideline and its work well ❤️.
But recently, after I have upgraded Next.Js from
9.3.5
to9.5.3
, another issue occurred. It has no problem onlocalhost
but onvercel
it throwfbt is not defined
error.Maybe it has been removed by webpack as the unused code.