Comments (23)
Okay, are you sure that App has default exports? Cuz if it does not, you will get this error
Even my vscode complains on the syntax above.
try
export { App } from './App';
from fuse-box.
Yes it does. see fork
from fuse-box.
It says Declaration or statement expected
from fuse-box.
Sorry about that. Fixed the import. Still same error
from fuse-box.
If acorn complains that means that you have a syntax error
from fuse-box.
@VanthiyaThevan is it possible that you are using some feature that needs some babel plugin, or you are just using the original repo code?
from fuse-box.
I'm actually getting this error (Unexpected token) and error reporting from acorn really doesn't help.
from fuse-box.
@VanthiyaThevan i checked the project,
first there is syntax error here react example
cons
should be const
also
export App from './App';
should be
export { App } from './App';
after i fixed those, build is passing fine, hope this helps
from fuse-box.
Also please, make sure you references make sense
https://github.com/vanthiyathevan/react-example/blob/master/src/App/index.js#L1
You don't have App.js
file in that folder.
from fuse-box.
the difference to this working vs the the error
this throws error
export App from './App'
This compiles as expected.
import App from './App'
export { App };
@devmondo It is possible. I've switched to using presets latest
, stage-0
, and react
and explicitly added transform-export-extensions
. Still same acorn error.
from fuse-box.
@VanthiyaThevan thanks for update,
can you try this export {App} from './App'
directly without import statement.
from fuse-box.
@devmondo
Hmm interesting. export {App} from './App' works. But given the ./App
is default export, Shouldn't export App from './App'
be working?
from fuse-box.
export App from './App'
is not a valid syntax.
Please. read up here
from fuse-box.
I see now. the syntax I am using are part of proposal
- https://github.com/leebyron/ecmascript-export-default-from
- https://github.com/leebyron/ecmascript-export-ns-from
and stage 1 supported by babel and not by acorn.
see the astexplorer.net
from fuse-box.
I see. I think we can use babel AST as an alternative.
Required:
- A way to bypass
acorn parse
and use AST provided by other sources. (for example by babel-plugin)
from fuse-box.
1.3.13
has it fixed. stage-0 does not spit an error, however, is not giving me expected code back.
It transpiles it as "undefined". So it must be related to that plugin. Nonetheless, all questions to babel.
from fuse-box.
Thanks for the quick response. But if I specify my own test
without limit2project
this reverts to using only acron AST only because of This
from fuse-box.
Sorry, my bad. FIxed in v1.3.15
from fuse-box.
i can confirm that Error reporting in v1.3.16
is awesome now!!!
from fuse-box.
Nice! @devmondo Thanks,
Let's wait for @VanthiyaThevan to confirm that BabelPlugin is now using babel AST instead of acorn.
from fuse-box.
Thanks. This works. Yes the error message is very cool. Will try it on a real project and let you know.
The undefined
is because of babel transpiling.
Although when export is pointing to a non existing file, The transpiling goes through without errors. May be it should warn the file doesn't exist?
from fuse-box.
Hi!
Thanks!
Certainly a warning can be optional. But in essence, a user might require a file that's not in a bundle. And get it via dynamic imports
. So this has to be though through.
Thanks again for submitting this issue, it led to an amazing improvement on BabelPlugin and the core itself.
Cheers.
from fuse-box.
Thanks. I'm going to try this on a fairly large project.
from fuse-box.
Related Issues (20)
- pluginConsolidate not working HOT 1
- "manifest" RunProps are ignored
- css background-image url with @ in path is not managed as resource HOT 7
- incorrect removal of parentheses in `(-(--t))`
- fuse-box@4 vue2.x.x .vue files support
- Log output indicates that `'@'` characters in file paths are changed into `'undefined'`
- Incorrect processing of awaited brackets
- ESM output support HOT 3
- Node_modules folder debug HOT 1
- node-sass is deprecated HOT 2
- Sass, and non-existent .css.map files HOT 2
- Failed to resolve %23clip in a css file HOT 4
- Transpilation Error with fuse-box 4.0.0 (or maybe I'm simply blind) HOT 1
- 4.0.0 Dependency bundled as two separate instances in production build
- `rootDir` does not exist in type IPublicOutputConfig
- Cannot find module: fuse-box/sparky HOT 7
- Is it possible to share an assets folder between two projects?
- Support Angular 13
- TypeError: Cannot read property 'filename' of undefined HOT 4
- Archive project
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fuse-box.