Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Something went wrong: Error: Invalid option "file": must be a path #264

Open
prodtest375 opened this issue Jan 11, 2021 · 0 comments
Open

Comments

@prodtest375
Copy link

`const express = require('express')
const app = express()
const port = 3000
const theo = require("theo");

var obj = {

props: [
{
name: 'product-color',
type:'color',
value: '#ff0000',
category :'font-color'
},
{
name: 'product-colorone',
type:'color',
value: 'rgb(1,2,3)',
category :'font-color'
}
]
};

app.get('/', (req, res) => {
theo.convert({
transform: {
type: "web",
//file: "collection.json",
data : JSON.stringify(obj)
},
format: {
type: "less"
}
})
.then(scss => {
console.log(scss);
// $button-background: rgb(0, 112, 210);
})
.catch(error => console.log(Something went wrong: ${error}));
res.send('Hello World!')
})

app.listen(port, () => {
console.log(Example app listening at http://localhost:${port})
})`
I need to format the javascript object to design tokens, above is my code , it shows error like "Something went wrong: Error: Invalid option "file": must be a path", It works fine when I created json file and give that path in file option.
Any help appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant