demipixel / factorio-blueprint

Import and Export blueprint strings automagically with this handy dandy blueprint API
MIT License
105 stars 30 forks source link

ReferenceError: myData is not defined #30

Closed dewiniaid closed 6 years ago

dewiniaid commented 6 years ago

threw together some combinators for some proof of concept code (I'm trying to combine this, Combinator Graph Tool and viz.js into a Discord/Reddit bot), I managed to trigger the above error.

Using the following code (Blueprint string from Factorio 0.16.9)

Blueprint = require('factorio-blueprint');
bp = new Blueprint('0eNqtVdtum0AQ/Zd5rHBlXJtWqC9t1a+IotUaxvZIsKDZwSqy9t+zuyTUSSExaV4QswznMhe4wL7qsGUyAvkFqGiMhfzuApaORlfhTPoWIQcSrCEBo+sQaSY51ShUrIqm3pPR0jC4BMiU+Afy1CVvYgQu0UamETbuPgE0QkI4SIpBr0xX75E9xatACbSN9e82JvB7vFWWQA/52jP4fOGmUns86TP5ZJ9xoEqQZ7yfiaXzJyPjkLH6ARGtC8VLr7zfDyQGiyDABqQ0XBjLaydURpvOhWK9cLdZ6G778e5+zrnz91YF6oOuLN7uNZ3x+uWNsfrXbfp5N/otiQfuWLQp939RlX9c0ijUYojVU4U9XgJNi6wHOPgEk3q3S/V+kNwDsRW1bDofLS5r+vMa+LiTtlvA/CvWbXIsjoxoXg6GL2hBXHQk404ksJmZot3z5DiPt6DOTd9uVF9iQSXyq63cLmrlI+L/9fH3sIdXM+oFtpqjwBy+v6NBeEbu5UTmOGC3vYqLrg7c1IqMB4NcuEN3+3ZPNNHFb0X46OdX/5kEPLuNZcu+fd2s11m2y9bOPQCw90DS');

Yields:

ReferenceError: myData is not defined
    at Entity.parseFilters (D:\git\combinatorgraphbot\node_modules\factorio-blueprint\entity.js:123:35)
    at new Entity (D:\git\combinatorgraphbot\node_modules\factorio-blueprint\entity.js:48:12)
    at Blueprint.createEntityWithData (D:\git\combinatorgraphbot\node_modules\factorio-blueprint\index.js:131:17)
    at data.entities.forEach.entity (D:\git\combinatorgraphbot\node_modules\factorio-blueprint\index.js:60:12)
    at Array.forEach (<anonymous>)
    at Blueprint.fillFromObject (D:\git\combinatorgraphbot\node_modules\factorio-blueprint\index.js:54:19)
    at Blueprint.load (D:\git\combinatorgraphbot\node_modules\factorio-blueprint\index.js:40:17)
    at new Blueprint (D:\git\combinatorgraphbot\node_modules\factorio-blueprint\index.js:22:20)
    at repl:1:6
    at ContextifyScript.Script.runInThisContext (vm.js:44:33)
demipixel commented 6 years ago

Fixed, sorry about the delay, don't remember getting this, glad I randomly checked the issues here.