Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't import contentful in to react native project

See original GitHub issue

Hi there,

I am extremely excited about using contentful for my project, but I can’t get the JS library to work in a react-native project.

I get the following error: screen shot 2016-10-10 at 16 10 44

I have tried the following approaches:

import contentful from 'contentful'; 
// or
var contentful = require('contentful');

You can reproduce the bug by going to this repo and following the steps I have provided.

Help would be greatly appreciated.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

andreipfeiffercommented, Mar 2, 2020

@Khaledgarbaya do you know how can we add TS typings/intellisense when importing from contentful/dist/contentful.browser.min.js?

Khaledgarbayacommented, Jun 11, 2019

For reference, we have this workaround in the troubleshooting section

Read more comments on GitHub >

github_iconTop Results From Across the Web

Import contentful in to react-native - node.js - Stack Overflow
Hey Khaled -- it seems contentful sdk no longer works with react native, because it uses Node modules, which are rejected by expo....
Read more >
Getting started with React and Contentful
This guide to getting started with React explains how to connect a create-react-app application with Contentful's GraphQL API.
Read more >
Import Contentful In To React-Native - ADocLib
Use Contentful GraphQL in your React application. The main component in your bootstrapped React application is App.js. Let's edit the included functional.
Read more >
Setup Contentful and GraphQL Apollo Client in React Native
In this post, I'm going to set up Contentful (a headless CMS platform) in React Native App using GraphQL Apollo Client. I'll show...
Read more >
react-contentful - npm
Start using react-contentful in your project by running `npm i react-contentful`. There are 4 other projects in the npm registry using ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found