Tailwind running with Next gives a syntax error - tailwind-css

./node_modules/next/dist/compiled/css-loader/cjs.js??ruleSet[1].rules[3].oneOf[7].use[1]!./node_modules/next/dist/compiled/postcss-loader/cjs.js??ruleSet[1].rules[3].oneOf[7].use[2]!./node_modules/next/dist/compiled/resolve-url-loader/index.js??ruleSet[1].rules[3].oneOf[7].use[3]!./node_modules/next/dist/compiled/sass-loader/cjs.js??ruleSet[1].rules[3].oneOf[7].use[4]!./styles/style.scss
/home/user/node_modules/color/index.js:257
lum[i] = (chan <= 0.039_28) ? chan / 12.92 : ((chan + 0.055) / 1.055) ** 2.4;
^^^^^
SyntaxError: Invalid or unexpected token

Looks like it's a node version issue.
https://github.com/tailwindlabs/tailwindcss/issues/921
Use Node 14 for example

Related

Getting Curl "Unsupported protocol" error

So i am trying to build a project with gcc and it emits the following compile failure
/home/cha/sdk-folder/sdk-source/avs-device-sdk/AVSCommon/Utils/src/LibcurlUtils/CurlEasyHandleWrapper.cpp:247:26: error: ‘CURLOPT_HTTPPOST’ is deprecated: since 7.56.0. Use CURLOPT_MIMEPOST [-Werror=deprecated-declarations]
247 | ret = setopt(CURLOPT_HTTPPOST, m_post);
| ^~~~~~~~~~~~~~~~
In file included from /home/cha/sdk-folder/sdk-source/avs-device-sdk/AVSCommon/Utils/include/AVSCommon/Utils/LibcurlUtils/CurlEasyHandleWrapper.h:20,
from /home/cha/sdk-folder/sdk-source/avs-device-sdk/AVSCommon/Utils/src/LibcurlUtils/CurlEasyHandleWrapper.cpp:20:
/usr/include/curl/curl.h:1195:3: note: declared here
1195 | CURLOPTDEPRECATED(CURLOPT_HTTPPOST, CURLOPTTYPE_OBJECTPOINT, 24,
| ^~~~~~~~~~~~~~~~~
/home/cha/sdk-folder/sdk-source/avs-device-sdk/AVSCommon/Utils/src/LibcurlUtils/CurlEasyHandleWrapper.cpp: In member function ‘void alexaClientSDK::avsCommon::utils::libcurlUtils::CurlEasyHandleWrapper::cleanupResources()’:
/home/cha/sdk-folder/sdk-source/avs-device-sdk/AVSCommon/Utils/src/LibcurlUtils/CurlEasyHandleWrapper.cpp:302:22: error: ‘void curl_formfree(curl_httppost*)’ is deprecated: since 7.56.0. Use curl_mime_free() [-Werror=deprecated-declarations]
302 | curl_formfree(m_post);
| ~~~~~~~~~~~~~^~~~~~~~
/usr/include/curl/curl.h:2606:1: note: declared here
2606 | curl_formfree(struct curl_httppost *form);
| ^~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[3]: *** [AVSCommon/CMakeFiles/AVSCommon.dir/build.make:734: AVSCommon/CMakeFiles/AVSCommon.dir/Utils/src/LibcurlUtils/CurlEasyHandleWrapper.cpp.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:11124: AVSCommon/CMakeFiles/AVSCommon.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:18943: SampleApplications/ConsoleSampleApplication/src/CMakeFiles/SampleApp.dir/rule] Error 2
make: *** [Makefile:5093: SampleApp] Error 2
basically the project is using deprecated API's . While trying to upgrade it to use the new API i am encountering a weird behaviour where the execution of that line fails and the curl error message that i am receiving is Unsupported protocol
auto result = curl_easy_setopt(handle, option, value);
Please note that value of option and value are CURLOPT_HTTP_VERSION and CURL_HTTP_VERSION_2_0
but if i add the following curl code above the above mentioned code snippet as shown below than everything starts to work magically
FILE *filep = fopen("~/dump.txt", "wb");
if(handle) {
curl_easy_setopt(handle, CURLOPT_STDERR, filep);
}
auto result = curl_easy_setopt(handle, option, value);
it seems like curl_easy_setopt(handle, CURLOPT_STDERR, filep);
must happen before curl_easy_setopt(handle, option, value)otherwise i get the unsupported protocol error. Can someone more experienced than me knows why that is happening or what i might be missing here.
Please note that initially i thought that the program is succeeding maybe due to some timing issue therefore i also tried putting some delay above auto result = curl_easy_setopt(handle, option, value); but still saw the same error message.

Uncaught DOMException: Failed to execute 'getImageData' on 'CanvasRenderingContext2D

I upgraded to version 4 and I am getting this error , But I have no idea where its coming from
Uncaught DOMException: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The source height is 0.
Its coming around axis = chart.addAxisY(true);
But my chart and everything is created .
Finally found where the bug is happening , if I remove this part that error is not coming , is anything depreciated in below code in version 4 ?
lastsignalname = chart.addUIElement(UIElementBuilders.TextBox, { x: axisX, y: axisY })

Why I cannot create a simple dictionary here

I am trying to create and use a simple dictionary using TFPGmap:
program rnTFPGmap;
{$mode objfpc}
uses fgl;
var
mydict: specialize TFPGmap<string, string>;
key: string;
i: longint;
begin
mydict.create;
mydict.add('k1','v1');
mydict.add('k2','v2');
mydict.add('k3','v3');
//for key in mydict.keys do {does not work either;}
for i := 1 to length(mydict) do {line 17: first error from here. }
writeln(mydict[i]);
end.
However, it is giving following error:
$ fpc soq_rntfpgmap
Free Pascal Compiler version 3.0.0+dfsg-11+deb9u1 [2017/06/10] for x86_64
Copyright (c) 1993-2015 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling soq_rntfpgmap.pas
soq_rntfpgmap.pas(17,16) Error: Type mismatch
soq_rntfpgmap.pas(18,19) Error: Incompatible type for arg no. 1: Got "LongInt", expected "ShortString"
soq_rntfpgmap.pas(22) Fatal: There were 2 errors compiling module, stopping
Fatal: Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode
Edit: I tried to modify the code according to documentation and came up with following version:
program rnTFPGmap;
{$mode objfpc}
uses fgl;
type
tuple = specialize TFPGmap<string, string>;
mydict = Array of tuple;
var
dict: mydict;
i: tuple;
item: string;
begin
setlength(dict, length(dict)+3);
dict.add('k1','v1'); {error on this line: "CREATE" expected but "ADD" found}
dict.add('k2','v2');
dict.add('k3','v3');
writeln('dict.count: ', dict.count);
for i in dict do
writeln(i);
end.
But I am now getting following error:
$ fpc soq_rntfpgmap
Free Pascal Compiler version 3.0.0+dfsg-11+deb9u1 [2017/06/10] for x86_64
Copyright (c) 1993-2015 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling soq_rntfpgmap.pas
soq_rntfpgmap.pas(13,25) Warning: Variable "dict" of a managed type does not seem to be initialized
soq_rntfpgmap.pas(14,7) Fatal: Syntax error, "CREATE" expected but "ADD" found
Fatal: Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode
Not able to sort this out.
Following code works. See comments for some explanations:
program rnTFPGmap;
{$mode objfpc}
uses fgl;
type
Rndict = specialize TFPGmap<string, string>;{define type under type}
var
dict: Rndict; {define object under var}
i: integer;
{main: }
begin
dict := Rndict.Create; {create object in main}
dict.add('k1','v1');
dict.add('k2','v2');
dict.add('k3','v3');
for i := 0 to (dict.count-1) do begin
writeln('i: ',i, '; key: ', dict.getkey(i), '; value: ', dict.getdata(i));
end;
end.
Output:
i: 0; key: k1; value: v1
i: 1; key: k2; value: v2
i: 2; key: k3; value: v3
I thank #DavidHeffernan for his guidance.

Parse data as time with function (Python)

Getting the following error following an execution of the following code. Using Py3 on Jupyter.
def parse_date(date):
if date == '':
return None
else:
return dt.strptime(str(date, '%d/%m/%y').date()`
raw_data_1.Date = raw_data_1.Date.apply(parse_date)
raw_data_2.Date = raw_data_2.Date.apply(parse_date)
File "<ipython-input-16-262d54bff117>", line 9
raw_data_1.Date = raw_data_1.Date.apply(parse_date)
^
SyntaxError: invalid syntax

There is an error using CMUCL

When staring cmucl with quicklisp, i get the following error:
Error in KERNEL::UNDEFINED-SYMBOL-ERROR-HANDLER: the function GENERATE-CRC32-TABLE is undefined.
[Condition of type UNDEFINED-FUNCTION]
Restarts:
0: [CONTINUE ] Return NIL from load of #P"/home/***/.cache/common-lisp/cmu-19f__19f_-freebsd-x86/home/***/quicklisp/quicklisp/deflate.sse2f".
1: [TRY-RECOMPILING] Recompile deflate and try loading it again
2: [RETRY ] Retry Loading component: ("quicklisp" "deflate").
3: [ACCEPT ] Continue, treating
Loading component: ("quicklisp" "deflate") as having
been successful.
4: Return NIL from load of #P"home:quicklisp/setup.lisp".
5: Return NIL from load of "home:.cmucl-init".
6: [ABORT ] Skip remaining initializations.
Debug (type H for help)
(KERNEL::UNDEFINED-SYMBOL-ERROR-HANDLER "<error finding name>"
#.(SYSTEM:INT-SAP #x47FD70D4)
#<Alien (*
SYSTEM:SYSTEM-AREA-POINTER) at #x47FD6DC0>
(16))
Source: Error finding source:
Error in function DEBUG::GET-FILE-TOP-LEVEL-FORM: Source file no longer exists:
target:code/interr.lisp.
How can i fix it, thanks !
The easiest fix is to use a recent version of CMUCL.

Resources