Import issues with Grommet 1.3.0
See original GitHub issueI’ve upgraded from Grommet 1.2.1 to 1.3.0 and found a couple of issues with my imports.
Here’s an example of how I include Grommet’s components using ES6 and Babel:
My custom app class:
import Grommet from 'grommet';
export class App extends React.Component {
static propTypes = {
children: React.PropTypes.element
}
constructor() {
super();
}
render() {
return (
<Grommet.App centered={ false }>
{ this.props.children }
</Grommet.App>
);
}
}
After upgrading Node complained Cannot read property 'App' of undefined
. I had to change my import statement to this:
import GrommetApp from 'grommet/components/App';
Similar is true for icons. I used to be able to do
import { Icons } from 'grommet';
//...
render() {
return <Icons.Base.Menu />;
}
//...
This throws the similar error Cannot read property 'Base' of undefined
.
I understand that it’s not necessarily optimal to import Grommet
and Icons
directly, but is this really an intentional change between 1.2.1 and 1.3.0?
Your Environment
- Grommet version: 1.3.0
- Node v4.4.7 with Babel and Webpack
Issue Analytics
- State:
- Created 7 years ago
- Comments:18 (13 by maintainers)
Top Results From Across the Web
Importing issues from CSV - GitLab Docs
The user uploading the CSV file is set as the author of the imported issues. You must have at least the Developer role...
Read more >CSV import issues. Receiving an error - WordPress.org
I exported my inventory file made updates and now when I try and import the file I get an error. “Sorry, this file...
Read more >[Archivesspace_Users_Group] Importing Accessions with CSV ...
Re: Problems with ASpace reports (Karrie L Roberson) > 9. import error, ... (1.0ms) > > Rendered > /opt/archivesspace-1.3.0/archivesspace/ ...
Read more >Import Products for Magento 2 - Amasty
Import Magento 2 products with images, reviews, categories and any other data you need. ... interfaces to complete the most sophisticated import challenges....
Read more >Plugin: CSV Import - Mantis Bug Tracker - Forums
Thinking maybe the columns had changed, I exported an issue using the CSV Export and compared the column names. The names all matched...
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
Humm 😢
I need to double check that, but you are probably right. Sorry it is being a while since I’ve touch the commonjs bundle and I apologize for the back and forth.
I’m happy to tell you that this works as expected now 👍
Thanks for taking care of all the issues. I will rework our code to use the
Icon
postfix in future.