Giter VIP home page Giter VIP logo

lambda-comments's Issues

In lambda-comments.json, line 145 and 181, change "nodejs" to "nodejs4.3"

Hi Jim,

My name is Vam. I live in Beijing, China. First of all, I want to say - thank you very much!! I am so so excited when I found your work - It is exactly what I need and it is amazing! You know that Disqus and many other popular sites are blocked in China for some reasons. And I want to have a simple commenting system that can be accessed from China and all over the world. I spent a lot of time tried to find a right one but I didn't. Until I see your Lambda-comments. And I agreed with your point of view from "Introducing lambda-comments". I just integrated it. Please have a look:

http://vamworks.com/2016/paintings-and-drawings-by-me-before-2016/

However, during the process I got a problem: when I create a stack via the command:

npm run create-cloudformation

I saw this message when I check my AWS CloudFormation console:

console of CloudFormation: ROLLBACK_COMPLETE

lambdacomments-01

When click the stack name, I see the following problem from log:

Logical ID:

QueueCommentLambdaFunction

Status reason:

The runtime parameter of nodejs is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs4.3) while creating or updating functions.

lambdacomments-02

I spent some time to did research and finally I found the answer:

http://docs.aws.amazon.com/cli/latest/reference/lambda/create-function.html

In lambda-comments.json, line 145 and 181, change "nodejs" to "nodejs4.3".

After that, it works very well!

:)

Best Regards,

Vam

Form does not show (OSX - Node v6.2.2) / Test fails (Linux - Node v5.7.0)

Hello, first of all thank you for your work. Second, I successfully deployed API and lambda functions and embed the javascript (without the akismet option). First with Node 6.0.0 then I tried with Node 6.2.2, both on OSX. Npm always runs test successfully but the only thing that appears in my page are these divs

div id="lambda-comments"
div data-reactid=".0"

so no comment form. No CORS errors in the browser. Apparently it is a frontend problem.

I also tried on a Linux VM with Node 5.7.0 (with and without sudo) and test fails (sometime it even fails during the install, running BootstrapCommand.execute when linking lambda-comments-utils dependencies). In this VM I am building without the akismet API key as well.

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]
Lerna v2.0.0-beta.9
Linking all dependencies
Errored while running BootstrapCommand.execute
Error: Command failed: npm install [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.>

at ChildProcess.exithandler (child_process.js:202:12)
at emitTwo (events.js:100:13)
at ChildProcess.emit (events.js:185:7)
at maybeClose (internal/child_process.js:827:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)> 

npm ERR! Linux 4.4.14-24.50.amzn1.x86_64
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "install-all"
npm ERR! node v5.7.0
npm ERR! npm v3.10.6
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install-all: npm install && lerna bootstrap && linklocal
npm ERR! Exit status 1

but if I re-run it successfully bootstrapps. And this is my test

passing (66ms)
8 failing>

  1. local Post new comment to the queue should return an id:
    TypeError: this is not a typed array.
    at Function.from (native)
    at Context. (test.js:33:29)>

  2. local Post new comment to the queue should fail if there is no data:
    TypeError: this is not a typed array.
    at Function.from (native)
    at Context. (test.js:55:29)>

  3. local Post new comment to the queue should catch spam:
    TypeError: this is not a typed array.
    at Function.from (native)
    at Context. (test.js:90:29)>

  4. local Post new comment to the queue should fail with a bad signature:
    TypeError: this is not a typed array.
    at Function.from (native)
    at Context. (test.js:124:29)>

  5. local Post new comment to the queue should allow posting hangul characters:
    TypeError: this is not a typed array.
    at Function.from (native)
    at Context. (test.js:159:29)>

  6. remote Post new comment to the queue should return an actionRef:
    TypeError: this is not a typed array.
    at Function.from (native)
    at Context. (test.js:214:29)>

  7. remote Post new comment to the queue should fail if there is no data:
    TypeError: this is not a typed array.
    at Function.from (native)
    at Context. (test.js:224:29)>

  8. remote Post new comment to the queue should allow posting hangul characters:
    TypeError: this is not a typed array.
    at Function.from (native)
    at Context. (test.js:252:29)>

Any suggestion?

Can't get it to run NPM test and pass

Tried to use today and everything worked until I got to the npm run test. Getting the following error:

1 failing

  1. local Post new comment to the queue should catch spam:
    Error: timeout of 5000ms exceeded. Ensure the done() callback is being called in this test

npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/Cellar/node/6.2.1/bin/node" "/usr/local/bin/npm" "run" "test"
npm ERR! node v6.2.1
npm ERR! npm v3.10.5
npm ERR! code ELIFECYCLE
npm ERR! [email protected] test: mocha --compilers js:./babel-register
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] test script 'mocha --compilers js:./babel-register'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the lambda-comments package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! mocha --compilers js:./babel-register
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs lambda-comments
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls lambda-comments
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/jbrodley/lambda-comments/npm-debug.log

from Debug log.

sxjbrodmbp:lambda-comments jbrodley$ vi /Users/jbrodley/lambda-comments/npm-debug.log

11 silly lifecycle [email protected]test: Args: [ '-c', 'mocha --compilers js:./babel-register' ]
12 silly lifecycle [email protected]
test: Returned: code: 1 signal: null
13 info lifecycle [email protected]~test: Failed to exec test script
14 verbose stack Error: [email protected] test: mocha --compilers js:./babel-register
14 verbose stack Exit status 1
14 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:242:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:191:7)
14 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:191:7)
14 verbose stack at maybeClose (internal/child_process.js:852:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
15 verbose pkgid [email protected]
16 verbose cwd /Users/jbrodley/lambda-comments
17 error Darwin 15.6.0
18 error argv "/usr/local/Cellar/node/6.2.1/bin/node" "/usr/local/bin/npm" "run" "test"
19 error node v6.2.1
20 error npm v3.10.5
21 error code ELIFECYCLE
22 error [email protected] test: mocha --compilers js:./babel-register
22 error Exit status 1
23 error Failed at the [email protected] test script 'mocha --compilers js:./babel-register'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the lambda-comments package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error mocha --compilers js:./babel-register
23 error You can get information on how to open an issue for this project with:
23 error npm bugs lambda-comments
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls lambda-comments
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

Use root akismet-api package

Hey there, congrats on reaching the front page of HN!
A colleague pointed out that you're using a forked version of my akismet-api library, I'm glad it's useful for building this. I was curious about the changes and I noticed you just updated superagent.

I had an issue for that here, but superagent changes the way it passes around errors in 1.0 so I had to do some additional testing to make sure everything was good.

I just released a new version (2.1.0) that supports superagent 1.8.3, so you might want to consider using the root akismet-api package again! If you have any other suggestions for the library, feel free to make an issue or pull request!

'npm start' in packages/frontend fails with Node 6.1.0

$ npm start

> @jimpick/[email protected] start /Users/jim/projects/comments/lambda-comments/packages/frontend
> if-env NODE_ENV=production && npm run react-project:start:prod || npm run react-project:start:dev


> @jimpick/[email protected] react-project:start:dev /Users/jim/projects/comments/lambda-comments/packages/frontend
> eslint src && react-project start

[react-project] [start] task
[react-project] checking app dependencies
[react-project] Some of your dependencies don't match what I expect
[react-project] You have: [email protected] and I expect [email protected]
[react-project] You have: [email protected] and I expect [email protected]
[react-project] You have: [email protected] and I expect [email protected]
[react-project] You have: [email protected] and I expect [email protected]
[react-project] You might want to `npm install` the versions I expect.
[react-project] NODE_ENV=development
/Users/jim/projects/comments/lambda-comments/packages/frontend/node_modules/react-project/lib/build.js:53
    if (err) throw err;
             ^

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.dirname (path.js:1324:5)
    at /Users/jim/projects/comments/lambda-comments/packages/frontend/node_modules/babel-core/lib/transformation/file/options/option-manager.js:374:36
    at /Users/jim/projects/comments/lambda-comments/packages/frontend/node_modules/babel-core/lib/transformation/file/options/option-manager.js:396:22
    at Array.map (native)
    at OptionManager.resolvePresets (/Users/jim/projects/comments/lambda-comments/packages/frontend/node_modules/babel-core/lib/transformation/file/options/option-manager.js:385:20)
    at OptionManager.mergePresets (/Users/jim/projects/comments/lambda-comments/packages/frontend/node_modules/babel-core/lib/transformation/file/options/option-manager.js:369:10)

Changing Access-Control-Allow-Origin header from https to http

After I enable the frontend I get:

GET https://s3-eu-central-1.amazonaws.com/myblogcomments-../comments.json 403 (Forbidden)

And when posting:

"Fetch API cannot load https://xxx.execute-api.eu-central-1.amazonaws.com/prod/comments. Response to preflight request doesn't pass access control check: The 'Access-Control-Allow-Origin' header has a value 'https://www.website.org' that is not equal to the supplied origin. Origin 'http://www.website.org' is therefore not allowed access. Have the server send the header with a valid value, or, if an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled."

I can't seem to be able to change from https to http, any hint on how to change it?

npm run install-all fails, then just plain old npm install fails

sudo npm run install-all gives:

npm ERR! Linux 3.13.0-74-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "install-all"
npm ERR! node v6.1.0
npm ERR! npm  v3.8.6
npm ERR! code ELIFECYCLE
npm ERR! @jimpick/[email protected] install-all: `npm install && cd packages/frontend && npm install`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @jimpick/[email protected] install-all script 'npm install && cd packages/frontend && npm install'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the @jimpick/lambda-comments package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm install && cd packages/frontend && npm install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs @jimpick/lambda-comments
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls @jimpick/lambda-comments
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! Please include the following file with any support request:
npm ERR!     /home/ubuntu/lambda-comments/npm-debug.log

sudo npm install on its own gives:

npm ERR! Linux 3.13.0-74-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v6.1.0
npm ERR! npm  v3.8.6                                                                      npm ERR! code E404

npm ERR! 404 Not found : @jimpick/akismet-api
npm ERR! 404                                                                              npm ERR! 404  '@jimpick/akismet-api' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of '@jimpick/lambda-comments'               npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/ubuntu/lambda-comments/npm-debug.log

Something tells me that this may have to do with the recent security upgrade to 6.x and the apparent phasing-out of 5.x.

Allows posting of empty content

Entering spaces as content, or anything that will render to an empty markdown section is currently permitted.

Add some checks to ensure that the markdown renders out to something.

Working example?

Hello - is this in use anywhere that I can take a look?
Kind regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.