I've been experimenting with Polymer for a project I'm starting soon. I was able to install it and run it, but I tried implementing login/logout with cookie based sessions via external packages and I'm stalled. I tried universal-cookie and js-cookie but keep having problems such as "require is not defined" which I think are due to trying to integrate non-es6 code directly - I'm new to modern frontend development, so bear with me.
I also tried the webpack branch and tried doing the same, and it works out of the box.
That being said, I have a couple of questions, the first being am I doing something wrong or missing something really obvious regarding the use of external packages (via npm) with the original starter kit? And if not, why does the webpack branch work, shouldn't the two approaches be similar in scope?
Your observations are entirely correct - those modules aren't distributed as ES modules and that's why only the webpack branch works. See the FAQ for more details.
Hi all,
I've been experimenting with Polymer for a project I'm starting soon. I was able to install it and run it, but I tried implementing login/logout with cookie based sessions via external packages and I'm stalled. I tried
universal-cookie
andjs-cookie
but keep having problems such as "require is not defined" which I think are due to trying to integrate non-es6 code directly - I'm new to modern frontend development, so bear with me.I also tried the webpack branch and tried doing the same, and it works out of the box.
That being said, I have a couple of questions, the first being am I doing something wrong or missing something really obvious regarding the use of external packages (via npm) with the original starter kit? And if not, why does the webpack branch work, shouldn't the two approaches be similar in scope?
Thanks in advance,