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

CLI errors immediately #169

Closed
brandonpittman opened this issue Nov 9, 2019 · 3 comments
Closed

CLI errors immediately #169

brandonpittman opened this issue Nov 9, 2019 · 3 comments

Comments

@brandonpittman
Copy link
Contributor

Tried the CLI, but it's not working.

❯ echo '{{"hello" | capitalize}}' | npx liquidjs
npx: installed 1 in 3.236s
(node:85312) UnhandledPromiseRejectionWarning: TypeError: Liquid is not a constructor
    at render (/Users/brandonpittman/.npm/_npx/85312/lib/node_modules/liquidjs/bin/liquid.js:10:18)
    at Socket.<anonymous> (/Users/brandonpittman/.npm/_npx/85312/lib/node_modules/liquidjs/bin/liquid.js:7:31)
    at Socket.emit (events.js:215:7)
    at endReadableNT (_stream_readable.js:1183:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
(node:85312) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:85312) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
@harttle harttle added the bug label Nov 9, 2019
@harttle harttle closed this as completed in 0073b90 Nov 9, 2019
harttle pushed a commit that referenced this issue Nov 9, 2019
## [9.3.1](v9.3.0...v9.3.1) (2019-11-09)

### Bug Fixes

* liquidjs command in /bin/liquid.js, fixes [#169](#169) ([0073b90](0073b90))
@harttle
Copy link
Owner

harttle commented Nov 9, 2019

🎉 This issue has been resolved in version 9.3.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@FickleLife
Copy link

FickleLife commented Apr 9, 2020

I am currently getting TypeError: Liquid is not a constructor, am running on a serverless Glitch function. Version is 9.11.10.

Code is

const Liquid = require('liquidjs');
const path = require('path');

const transformWeather = (data) => {
  const engine = new Liquid({
    root: path.resolve(__dirname, 'liquid/'),  
    extname: '.liquid'
  });

  engine
    .renderFile('wwo', data)
    .then(console.log)
}

Any clues why this would be happening?

@harttle
Copy link
Owner

harttle commented Apr 9, 2020

Use const {Liquid} = require('liquidjs'); instead.

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

No branches or pull requests

3 participants