This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Alex Maximets
Posted Apr 10 - Read on Facebook

Hi Team, I'm working on integrating mapbox into my project by following this guide:https://www.mapbox.com/help/mobile-framer/.
Problem is whenever i run "npm install map box-gl" I get an error (attached). Does someone know a way to get this to work?

Thanks

6 Comments

Dmitrii Ivashko

Try executing 'npm init -y' first to initialize the npm project in the current directory

Alex Maximets

That created "package.json" file and when i try to run "nom install map box-gl" it returns: (attached) and then writes npm WARN no Description and npm WARN no repository field, but it does create a "node module" folder.. but yeah framer still doesn't like it

Dmitrii Ivashko

Warnings are fine. That's because the package file has not been edited with real description. That's perfectly fine. I can look into the issue when I'm back at the office

Dmitrii Ivashko

Alexander Maximets Okay I've checked it and it works as expected. You should keep in mind, that Framer Studio can't work with npm packages directly, so you have to export those through modules first. If you havent done this, it might be the cause of your problem.

Let me know if this helps:

1) navigate to the framer project folder
2) >> npm init -y
3) >> npm install -S mapbox-gl
4) go to '/modules' folder and create a 'npm.coffee' file and open it with any text editor. Add this line to the file:
>> exports.mapboxgl = require "mapbox-gl"
5) Go back to framer and add these lines
>> { mapboxgl } = require "npm"

If you did everything correctly, you should be able to do "print mapboxgl" and see some console output. If it works, then framer sees your npm package and it's not framer's issue and you might be just using mapbox incorrectly. If you get an error on print, or it produces a null output, see the steps above and check whether you've missed anything or not

Alex Maximets

I've followed all your instructions Dmitrii, this is what I get in framer:

Alex Maximets

Dmitrii Ivashko I'm trying to integrate the datasets using the guide at: https://www.mapbox.com/blog/power-framer-prototype-with-mapbox/ and I keep getting an error message "can't find variable dataset" (code attached). Can you please give me a hand with this

Read the entire post on Facebook